File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # SBATCH --job-name=my_job_name        # Job name
3+ # SBATCH --output=output.txt           # Standard output file
4+ # SBATCH --error=error.txt             # Standard error file
5+ # SBATCH --nodes=10                    # Number of nodes
6+ # SBATCH --ntasks-per-node=1           # Number of tasks per node
7+ # SBATCH --cpus-per-task=1             # Number of CPU cores per task
8+ # SBATCH --time=1:00:00                # Maximum runtime (D-HH:MM:SS)
9+ 
10+ # Your job commands go here
11+ cat <<  EOF  > run.py
12+ 
13+ from gradio_client import Client 
14+ 
15+ client = Client("https://insert-public-llm-address/") 
16+ 
17+ 
18+ for i in range(10): 
19+     result = client.predict("Tell me a short story", api_name="/chat") 
20+     print(result) 
21+ 
22+ EOF 
23+ 
24+ if  [[ !  -d  gradio-env ]];  then 
25+   python3 -m venv gradio-env
26+ fi 
27+ 
28+ source  gradio-env/bin/activate
29+ pip list |  grep gradio ||  pip install gradio
30+ 
31+ srun python3 run.py
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments