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/26b3f5829a0a521af864282f5dfa60bdc5113aa8/main.py
- Command line
-
hf download hf://spaces/HamidOmarov/FastAPI-RAG-API@26b3f5829a0a521af864282f5dfa60bdc5113aa8/main.py
-
curl -L -o main.py https://huggingface.co/spaces/HamidOmarov/FastAPI-RAG-API/resolve/26b3f5829a0a521af864282f5dfa60bdc5113aa8/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"} | |