Download test_retrieve.py from GibChm/rag: direct link, hf CLI and curl.
- Browser
- Download file 319 Bytes
-
https://huggingface.co/spaces/GibChm/rag/resolve/main/test_retrieve.py
- Command line
-
hf download hf://spaces/GibChm/rag/test_retrieve.py
-
curl -L -o test_retrieve.py https://huggingface.co/spaces/GibChm/rag/resolve/main/test_retrieve.py
319 Bytes
| from retriever import BibleRetriever | |
| retriever = BibleRetriever( | |
| "model/bible.faiss", | |
| "model/bible_metadata.pkl" | |
| ) | |
| results = retriever.retrieve_candidates( | |
| "God's promises", | |
| top_k=5 | |
| ) | |
| for r in results: | |
| print("=" * 80) | |
| print(r["reference"]) | |
| print(r["faiss_score"]) | |
| print(r["semantic"]) |