Load bge-m3 as safetensors for x86; update README, add EINSTIEG.md
- EMBEDDING_REVISION pins the official safetensors conversion of bge-m3, so the x86 env (torch 2.2.2) can load it; identical vectors, no index rebuild - README rewritten for the current state (personas, providers, retrieval, environments) - EINSTIEG.md: short German guide to running and configuring the chat Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,10 @@ CHUNK_OVERLAP = 400
|
||||
# Multilingual embedding model with a long input window (8192 tokens), so chunks
|
||||
# are never truncated. Changing it requires rebuilding the index.
|
||||
EMBEDDING_MODEL = "BAAI/bge-m3"
|
||||
# Same weights as safetensors (the official Hugging Face conversion, refs/pr/130). The main
|
||||
# branch only has pytorch_model.bin, which transformers refuses to load with torch < 2.6;
|
||||
# macOS x86 (conda env local_rag) is stuck at torch 2.2.2. Identical vectors, no index rebuild.
|
||||
EMBEDDING_REVISION = "9a0624b896d81da7492a910ffa53731274b6cf3d"
|
||||
|
||||
# How PDFs are read: "pypdf" (PyPDFLoader, one unit per page) or "docling"
|
||||
# (structured output from prepare_corpus.py, cleaned by docling_loader.py).
|
||||
@@ -105,6 +109,7 @@ def load_embeddings(model_name):
|
||||
# Normalized vectors: FAISS's L2 distance then ranks exactly like cosine similarity.
|
||||
_EMBEDDINGS[model_name] = HuggingFaceEmbeddings(
|
||||
model_name=model_name,
|
||||
model_kwargs={"revision": EMBEDDING_REVISION} if model_name == EMBEDDING_MODEL else {},
|
||||
encode_kwargs={"normalize_embeddings": True},
|
||||
query_encode_kwargs={"normalize_embeddings": True},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user