Download app.py from paczade/Sacrifice: direct link, hf CLI and curl.
- Browser
- Download file 346 Bytes
-
https://huggingface.co/spaces/paczade/Sacrifice/resolve/main/app.py
- Command line
-
hf download hf://spaces/paczade/Sacrifice/app.py
-
curl -L -o app.py https://huggingface.co/spaces/paczade/Sacrifice/resolve/main/app.py
346 Bytes
| from fastapi import FastAPI | |
| from rag import RAG | |
| app = FastAPI() | |
| rag = RAG() | |
| async def ask_question(payload: dict): | |
| question = payload.get("question", "") | |
| answer = rag.generate_answer(question) | |
| return {"answer": answer} | |
| if __name__ == "__main__": | |
| import uvicorn | |
| uvicorn.run(app, host="0.0.0.0", port=7860) | |