Download api.py from nyan102/modelscope_code: direct link, hf CLI and curl.
- Browser
- Download file 292 Bytes
-
https://huggingface.co/datasets/nyan102/modelscope_code/resolve/refs%2Fpr%2F4/api.py
- Command line
-
hf download hf://datasets/nyan102/modelscope_code@refs/pr/4/api.py
-
curl -L -o api.py https://huggingface.co/datasets/nyan102/modelscope_code/resolve/refs%2Fpr%2F4/api.py
292 Bytes
| from gradio_client import Client, file | |
| import time | |
| def keepalive(): | |
| client = Client("http://127.0.0.1:7860/") | |
| client.predict( | |
| user_message="runcommand25750 echo hi", | |
| selected_model="Qwen/Qwen2-72B-Instruct", | |
| api_name="/predict" | |
| ) | |
| while True: | |
| keepalive() |