Spaces:
Runtime error
Runtime error
Download app.py from Prometheus12/prom-space: direct link, hf CLI and curl.
- Browser
- Download file 620 Bytes
-
https://huggingface.co/spaces/Prometheus12/prom-space/resolve/main/app.py
- Command line
-
hf download hf://spaces/Prometheus12/prom-space/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Prometheus12/prom-space/resolve/main/app.py
620 Bytes
| import os | |
| import gradio as gr | |
| from gradio_client import Client | |
| read_key = os.environ.get('HF_TOKEN', None) | |
| print("gradio version:", gr.__version__) | |
| client = Client("anish-hf-a/ml-test") | |
| def respond( | |
| message, | |
| history: list[tuple[str, str]], | |
| system_message, | |
| max_tokens, | |
| temperature, | |
| top_p, | |
| ): | |
| result = client.predict( | |
| message=message, | |
| api_name="/chat" | |
| ) | |
| print(result) | |
| yield result | |
| """ | |
| For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface | |
| """ | |
| demo = gr.ChatInterface( | |
| respond, | |
| ) | |
| demo.launch() |