(retriever) - Pin HuggingFace model revisions#1499
Merged
jdye64 merged 3 commits intoNVIDIA:mainfrom Mar 6, 2026
Merged
Conversation
jioffe502
reviewed
Mar 6, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pin HuggingFace model revisions to immutable commit SHAs
Problem
All 14
from_pretrainedcalls across the codebase were loading models from HuggingFace without specifying arevision, which defaults to themainbranch. Any push tomainon any of our upstream HF model repos could silently change what gets downloaded, potentially breaking inference at runtime.Solution
Introduced a central model revision registry (
hf_model_registry.py) that maps each HuggingFace model ID to a pinned git commit SHA. Everyfrom_pretrainedcall now passesrevision=get_hf_revision(model_id), locking downloads to an exact, immutable snapshot.If a model ID isn't in the registry (e.g. a user-supplied custom model),
get_hf_revisionreturnsNone, which preserves the defaultmainbranch behavior -- so no existing flexibility is lost.Changes
New file:
nemo_retriever/src/nemo_retriever/utils/hf_model_registry.py-- single source of truth for all pinned model revisionsUpdated files (14
from_pretrainedcalls pinned):nemo_retriever/src/nemo_retriever/model/local/llama_nemotron_embed_1b_v2_embedder.py-- 2 calls (AutoTokenizer + AutoModel)nemo_retriever/src/nemo_retriever/model/local/llama_nemotron_embed_vl_1b_v2_embedder.py-- 1 call (AutoModel)nemo_retriever/src/nemo_retriever/model/local/nemotron_parse_v1_2.py-- 4 calls (AutoModel + AutoTokenizer + AutoProcessor + GenerationConfig)nemo_retriever/src/nemo_retriever/model/local/parakeet_ctc_1_1b_asr.py-- 2 calls (AutoProcessor + AutoModelForCTC)nemo_retriever/src/nemo_retriever/txt/split.py-- 1 call (AutoTokenizer)api/src/nv_ingest_api/internal/transform/split_text.py-- 1 call (AutoTokenizer)docker/scripts/post_build_triggers.py-- 1 call per model path (AutoTokenizer)Pinned revisions
nvidia/llama-3.2-nv-embedqa-1b-v2cefc2394cc541737b7867df197984cf23f05367fnvidia/parakeet-ctc-1.1ba707e818195cb97c8f7da2fc36b221a29f69a5dbnvidia/NVIDIA-Nemotron-Parse-v1.2f42c8040b12ee64370922d108778ab655b722c5dnvidia/llama-nemotron-embed-vl-1b-v2859e1f2dac29c56c37a5279cf55f53f3e74efc6bmeta-llama/Llama-3.2-1B4e20de362430cd3b72f300e6b0f18e50e7166e08intfloat/e5-large-unsupervised15af9288f69a6291f37bfb89b47e71abc747b206How to bump a model version
Update the single SHA entry in
hf_model_registry.py. All call sites will automatically pick up the new revision.Checklist