Skip to content

Commit 3d6a42f

Browse files
committed
fix mypy error
Signed-off-by: Zhiyu Cheng <[email protected]>
1 parent 24a4dfd commit 3d6a42f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/llm_ptq/hf_ptq.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ def main(args):
575575
print("Running text-only preview generation for Nemotron VL model...")
576576
try:
577577
# Try text-only generation using model.chat with None for images
578+
if tokenizer is None:
579+
raise ValueError("Tokenizer is required for Nemotron VL text generation")
580+
578581
question = tokenizer.decode(input_ids[0], skip_special_tokens=True)
579582
generation_config = {
580583
"max_new_tokens": 100,
@@ -639,6 +642,9 @@ def main(args):
639642
print("Running text-only preview generation for quantized Nemotron VL model...")
640643
try:
641644
# Try text-only generation using model.chat with None for images
645+
if tokenizer is None:
646+
raise ValueError("Tokenizer is required for Nemotron VL text generation")
647+
642648
question = tokenizer.decode(input_ids[0], skip_special_tokens=True)
643649
generation_config = {
644650
"max_new_tokens": 100,

0 commit comments

Comments
 (0)