Spaces:
Build error
Build error
Download api.py from wendellast/test: direct link, hf CLI and curl.
- Browser
- Download file 408 Bytes
-
https://huggingface.co/spaces/wendellast/test/resolve/main/api.py
- Command line
-
hf download hf://spaces/wendellast/test/api.py
-
curl -L -o api.py https://huggingface.co/spaces/wendellast/test/resolve/main/api.py
408 Bytes
| from gradio_client import Client | |
| from util.access_token import load_token | |
| TOKEN = load_token("TOKEN_READ") | |
| #Example Bot | |
| def bot_response(input_text: str) -> str: | |
| client = Client("PlanBTech/Medflow-Bot", hf_token=TOKEN) | |
| result = client.predict( | |
| message=input_text, | |
| max_tokens=512, | |
| temperature=0.7, | |
| top_p=0.95, | |
| api_name="/chat", | |
| ) | |
| return str(result) | |