Expand description
HuggingFace Hub download + cache-layout helpers for the BGE-M3 model files.
Structsยง
- Model
Files ๐ - Paths to the ONNX model and tokenizer files resolved from the hf-hub cache.
Constantsยง
- REPO_ID ๐
- REPO_
REVISION ๐ - Pinned HF commit โ prevents silent model updates and provides supply-chain integrity for the ONNX weights and tokenizer. Update this hash intentionally after verifying a new revision produces equivalent embeddings.
- XENOVA_
REPO_ ๐ID - XENOVA_
REPO_ ๐REVISION - Pinned HF commit for the Xenova/bge-m3 FP16 (~1.08 GB) and INT8 (~568 MB) models. Update intentionally after verifying equivalent embedding quality vs FP32.
Functionsยง
- download_
model_ ๐files - Downloads (or retrieves from the local hf-hub snapshot cache) the ONNX model and tokenizer files for the given model variant.
- is_
model_ ๐cached - Returns
truewhen the primary ONNX model file already exists in the hf-hub snapshot cache, meaningrepo.get()will return immediately without fetching from the network.