Spaces:
Sleeping
Sleeping
Download app.py from heeba001/afcon-topic-sentiment-api: direct link, hf CLI and curl.
- Browser
- Download file 336 Bytes
-
https://huggingface.co/spaces/heeba001/afcon-topic-sentiment-api/resolve/main/app.py
- Command line
-
hf download hf://spaces/heeba001/afcon-topic-sentiment-api/app.py
-
curl -L -o app.py https://huggingface.co/spaces/heeba001/afcon-topic-sentiment-api/resolve/main/app.py
336 Bytes
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| from utils import analyze_text | |
| app = FastAPI(title="AFCON Topic + Sentiment API") | |
| class InputText(BaseModel): | |
| text: str | |
| def health(): | |
| return {"status": "ok"} | |
| def analyze(payload: InputText): | |
| return analyze_text(payload.text) | |