From 3188a2c03e4125e549d191d2a7d836db8c5026b5 Mon Sep 17 00:00:00 2001 From: h-guo18 <67671475+h-guo18@users.noreply.github.com> Date: Tue, 16 Jun 2026 19:20:16 +0000 Subject: [PATCH] fix 6304585 Signed-off-by: h-guo18 <67671475+h-guo18@users.noreply.github.com> --- examples/speculative_decoding/README.md | 4 ++-- modelopt/torch/utils/plugins/transformers_dataset.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/speculative_decoding/README.md b/examples/speculative_decoding/README.md index 99336cc658d..27549bb8abd 100644 --- a/examples/speculative_decoding/README.md +++ b/examples/speculative_decoding/README.md @@ -78,7 +78,7 @@ For small base models that fit in GPU memory, we can collocate them with draft m ```bash ./launch_train.sh \ --config ../../modelopt_recipes/general/speculative_decoding/eagle3.yaml \ - model.model_name_or_path=meta-llama/Llama-3.2-1B \ + model.model_name_or_path=meta-llama/Llama-3.2-1B-Instruct \ data.data_path=input_conversations/train.jsonl \ training.output_dir=ckpts/llama-3.2-1b-online ``` @@ -123,7 +123,7 @@ Once we finish dumping hidden states, launch offline training pointing to the hi ```bash ./launch_train.sh \ --config ../../modelopt_recipes/general/speculative_decoding/eagle3.yaml \ - model.model_name_or_path=meta-llama/Llama-3.2-1B \ + model.model_name_or_path=meta-llama/Llama-3.2-1B-Instruct \ data.offline_data_path=$HIDDEN_STATES_DIR \ training.output_dir=ckpts/llama-3.2-1b-offline ``` diff --git a/modelopt/torch/utils/plugins/transformers_dataset.py b/modelopt/torch/utils/plugins/transformers_dataset.py index 44ee7629617..c27a3d09aea 100644 --- a/modelopt/torch/utils/plugins/transformers_dataset.py +++ b/modelopt/torch/utils/plugins/transformers_dataset.py @@ -160,7 +160,12 @@ def __init__( self._post_process_tokenizer() if self.tokenizer.chat_template is None: - raise ValueError("No valid chat template!") + raise ValueError( + "No valid chat template! The tokenizer for this model has no chat_template, " + "which is common for base / pretrained checkpoints. Use an instruction-tuned " + "model (e.g. a '*-Instruct' variant), or pass a custom chat_template via the " + "training config or LanguageDataCollator(chat_template=...)." + ) if self.answer_only_loss: self._verify_generation_tags()