Spaces:
Running
Running
Download rag/utils.py from Urvikava/Faculty-Finder-api: direct link, hf CLI and curl.
- Browser
- Download file 326 Bytes
-
https://huggingface.co/spaces/Urvikava/Faculty-Finder-api/resolve/main/rag/utils.py
- Command line
-
hf download hf://spaces/Urvikava/Faculty-Finder-api/rag/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/Urvikava/Faculty-Finder-api/resolve/main/rag/utils.py
326 Bytes
| import json | |
| from pathlib import Path | |
| BASE_DIR = Path(__file__).resolve().parents[1] | |
| DOCS_PATH = BASE_DIR / "rag" / "artifacts" / "faculty_documents.json" | |
| def load_faculty_documents(): | |
| with open(DOCS_PATH, "r", encoding="utf-8") as f: | |
| docs = json.load(f) | |
| return {d["faculty_id"]: d for d in docs} | |