Spaces:
Sleeping
Sleeping
Download app.py from boardman7/email_reply_public: direct link, hf CLI and curl.
- Browser
- Download file 415 Bytes
-
https://huggingface.co/spaces/boardman7/email_reply_public/resolve/main/app.py
- Command line
-
hf download hf://spaces/boardman7/email_reply_public/app.py
-
curl -L -o app.py https://huggingface.co/spaces/boardman7/email_reply_public/resolve/main/app.py
415 Bytes
| # Public Space:frontend.py | |
| import os, requests, gradio as gr | |
| API_URL = os.environ["BACKEND_URL"] # 在 Space Secrets 里配置 | |
| API_TOKEN = os.environ["HF_TOKEN"] # 也放 Secrets | |
| def run(x): | |
| r = requests.post(API_URL, json={"input": x}, | |
| headers={"Authorization": f"Bearer {API_TOKEN}"}) | |
| return r.json()["result"] | |
| gr.Interface(run, "textbox", "textbox").launch() | |