Skip to main content

Module model_files

Module model_files 

Source
Expand description

HuggingFace Hub download + cache-layout helpers for the BGE-M3 model files.

Structsยง

ModelFiles ๐Ÿ”’
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 true when the primary ONNX model file already exists in the hf-hub snapshot cache, meaning repo.get() will return immediately without fetching from the network.