Spaces:
Sleeping
Sleeping
Download main.py from HamidOmarov/FastAPI-RAG-API: direct link, hf CLI and curl.
- Browser
- Download file 442 Bytes
-
https://huggingface.co/spaces/HamidOmarov/FastAPI-RAG-API/resolve/7d8f85a40e6238a329d459ef83d60b0a67ecf641/main.py
- Command line
-
hf download hf://spaces/HamidOmarov/FastAPI-RAG-API@7d8f85a40e6238a329d459ef83d60b0a67ecf641/main.py
-
curl -L -o main.py https://huggingface.co/spaces/HamidOmarov/FastAPI-RAG-API/resolve/7d8f85a40e6238a329d459ef83d60b0a67ecf641/main.py
442 Bytes
| # --- ADD: /generate alias for compatibility --- | |
| from fastapi import Form | |
| async def generate_alias( | |
| file: UploadFile = File(...), | |
| num_questions: int = Query(20, ge=1, le=200), | |
| language: str = Query("en") | |
| ): | |
| # simply call the real generator | |
| return await generate_dataset(file=file, num_questions=num_questions, language=language) | |
| def health_alias(): | |
| return {"status": "ok"} | |