Download app.py from THED1/Ok2: direct link, hf CLI and curl.
- Browser
- Download file 427 Bytes
-
https://huggingface.co/spaces/THED1/Ok2/resolve/main/app.py
- Command line
-
hf download hf://spaces/THED1/Ok2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/THED1/Ok2/resolve/main/app.py
427 Bytes
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| app = FastAPI() | |
| class ChatRequest(BaseModel): | |
| prompt: str | |
| def root(): | |
| return { | |
| "status": "running", | |
| "message": "Space is working" | |
| } | |
| def health(): | |
| return { | |
| "healthy": True | |
| } | |
| def chat(req: ChatRequest): | |
| return { | |
| "reply": f"You said: {req.prompt}" | |
| } |