Spaces:
Runtime error
Runtime error
Download main.py from SolomonHsu/test: direct link, hf CLI and curl.
- Browser
- Download file 465 Bytes
-
https://huggingface.co/spaces/SolomonHsu/test/resolve/main/main.py
- Command line
-
hf download hf://spaces/SolomonHsu/test/main.py
-
curl -L -o main.py https://huggingface.co/spaces/SolomonHsu/test/resolve/main/main.py
465 Bytes
| import requests | |
| from . import app | |
| API_URL = "https://api-inference.huggingface.co/models/google/gemma-1.1-7b-it" | |
| def query(payload): | |
| response = requests.post(API_URL, json=payload) | |
| return response.json() | |
| def api_home(): | |
| return {'detail': 'Welcome to FastAPI TextGen Tutorial!'} | |
| def inference(input: str): | |
| return query({"inputs": input}) | |