Add bge-reranker-v2-m3; fix metadata and chunking bugs

This commit is contained in:
Eric Furst 2026-09-20 12:01:11 -04:00
commit 24a38ac43f
8 changed files with 149 additions and 23 deletions

View file

@ -19,7 +19,7 @@ from pathlib import Path
os.chdir(Path(__file__).resolve().parent.parent)
os.environ["TOKENIZERS_PARALLELISM"] = "false"
os.environ["SENTENCE_TRANSFORMERS_HOME"] = "./models"
os.environ["HF_HUB_CACHE"] = "./models" # HF hub cache for offline model loads
os.environ["HF_HUB_OFFLINE"] = "1"
import chromadb
@ -45,7 +45,9 @@ EMBED_MODEL = HuggingFaceEmbedding(
)
# Cross-encoder model for re-ranking (cached in ./models/)
RERANK_MODEL = "cross-encoder/ms-marco-MiniLM-L-12-v2"
# Must match query_hybrid.py -- see the note there on why this replaced
# cross-encoder/ms-marco-MiniLM-L-12-v2.
RERANK_MODEL = "BAAI/bge-reranker-v2-m3"
RERANK_TOP_N = 15
RETRIEVE_TOP_K = 30