Spaces:
Sleeping
Sleeping
fix(runtime): pick writable DATA_DIR via storage module; create dirs on startup; remove hardcoded /data
649d2d5 Download app/utils.py from HamidOmarov/FastAPI-RAG-API: direct link, hf CLI and curl.
- Browser
- Download file 237 Bytes
-
https://huggingface.co/spaces/HamidOmarov/FastAPI-RAG-API/resolve/1171cbae9bf3d608916df6ab7575cdc9063bddb2/app/utils.py
- Command line
-
hf download hf://spaces/HamidOmarov/FastAPI-RAG-API@1171cbae9bf3d608916df6ab7575cdc9063bddb2/app/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/HamidOmarov/FastAPI-RAG-API/resolve/1171cbae9bf3d608916df6ab7575cdc9063bddb2/app/utils.py
237 Bytes
| # app/utils.py | |
| import uuid | |
| from fastapi import HTTPException | |
| def ensure_session(session_id: str | None) -> str: | |
| return session_id or str(uuid.uuid4()) | |
| def http400(msg: str): | |
| raise HTTPException(status_code=400, detail=msg) | |