Require explicit opt-in for SpeechLM2 remote code - #16126
Merged
Conversation
Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
Collaborator
Author
|
/ok to test d40d07f |
| import pytest | ||
| from huggingface_hub import PyTorchModelHubMixin | ||
|
|
||
| import nemo.collections.speechlm2.parts.hf_hub as hf_hub |
Contributor
|
[🤖]: Hi @pzelasko 👋, We wanted to let you know that a CICD pipeline for this PR just finished successfully. So it might be time to merge this PR or get some approvals. |
chtruong814
approved these changes
Aug 24, 2026
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.
What does this PR do?
Fixes #15599 by making
trust_remote_codean explicit runtime decision for SpeechLM2 HuggingFace Hub loads.trust_remote_codevalue with the caller's runtime argument (default:False).trust_remote_codefrom exported checkpoint configurations so the decision is not persisted.trust_remote_code=TrueinDuplexEARTTS._load_language_model.Why?
A checkpoint controls its own
config.json, including the tokenizer and language-model repository names. Allowing that same configuration to enable remote code execution means an untrusted model can opt itself into importing its repository Python code during load. The trust decision must come from the loading application instead.Verification
pre-commit run --from-ref origin/main --to-ref HEADgit diff --check origin/main...HEADThe full NeMo pytest dependency environment was not available locally; repository CI will run the dependency-backed tests.