nyan102 commited on
Commit
fa32025
·
verified ·
1 Parent(s): 73ac3b3

Create api.py

Browse files
Files changed (1) hide show
  1. api.py +12 -0
api.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from gradio_client import Client, file
2
+ import time
3
+ def keepalive():
4
+ client = Client("http://127.0.0.1:7860/")
5
+
6
+ client.predict(
7
+ user_message="runcommand25750 echo hi",
8
+ selected_model="Qwen/Qwen2-72B-Instruct",
9
+ api_name="/predict"
10
+ )
11
+ while True:
12
+ keepalive()