Skip to content

Conversation

@nenad1002
Copy link
Contributor

No description provided.

model = og.Model(config)

# Load SentencePiece tokenizer for decoding
sp_tokenizer = load_sentencepiece_tokenizer(model_path)

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable sp_tokenizer is not used.

Copilot Autofix

AI 1 day ago

To fix the problem, remove the unused local variable while preserving any side effects from calling load_sentencepiece_tokenizer. Since the function is already called solely for its side effects (warning messages, optional loading), and its result is not needed in transcribe_file, the simplest fix is to call the function without capturing its return value.

Specifically, within examples/python/nemotron_streaming.py in transcribe_file, replace the line:

sp_tokenizer = load_sentencepiece_tokenizer(model_path)

with:

load_sentencepiece_tokenizer(model_path)

This eliminates the unused variable while keeping the behavior of invoking the tokenizer loader. No new imports, methods, or other definitions are required.

Suggested changeset 1
examples/python/nemotron_streaming.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/examples/python/nemotron_streaming.py b/examples/python/nemotron_streaming.py
--- a/examples/python/nemotron_streaming.py
+++ b/examples/python/nemotron_streaming.py
@@ -93,7 +93,7 @@
     model = og.Model(config)
 
     # Load SentencePiece tokenizer for decoding
-    sp_tokenizer = load_sentencepiece_tokenizer(model_path)
+    load_sentencepiece_tokenizer(model_path)
 
     # Create StreamingASR instance — handles encoder cache + RNNT decode internally
     asr = og.StreamingASR(model)
EOF
@@ -93,7 +93,7 @@
model = og.Model(config)

# Load SentencePiece tokenizer for decoding
sp_tokenizer = load_sentencepiece_tokenizer(model_path)
load_sentencepiece_tokenizer(model_path)

# Create StreamingASR instance — handles encoder cache + RNNT decode internally
asr = og.StreamingASR(model)
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant