Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nb/Kaggle-Whisper.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@
" train_dataset = train_dataset,\n",
" data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor = tokenizer),\n",
" eval_dataset = test_dataset,\n",
" tokenizer = tokenizer.feature_extractor,\n",
" processing_class = tokenizer.feature_extractor,\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the tokenizer variable actually holds the full processor (as indicated by processor = tokenizer in the data collator), passing tokenizer directly to processing_class is highly recommended. If you only pass tokenizer.feature_extractor, the trainer will only save the feature extractor configuration (preprocessor_config.json) and will omit the tokenizer configuration files (like tokenizer_config.json, vocab.json, etc.) when trainer.save_model() is called. Passing the full processor ensures that both the feature extractor and tokenizer are properly saved, making the saved model fully self-contained and ready for inference or resuming training.

Suggested change
" processing_class = tokenizer.feature_extractor,\n",
" processing_class = tokenizer,\\n",

" compute_metrics = compute_metrics,\n",
" args = Seq2SeqTrainingArguments(\n",
" # predict_with_generate = True,\n",
Expand Down
2 changes: 1 addition & 1 deletion nb/Whisper.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@
" train_dataset = train_dataset,\n",
" data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor = tokenizer),\n",
" eval_dataset = test_dataset,\n",
" tokenizer = tokenizer.feature_extractor,\n",
" processing_class = tokenizer.feature_extractor,\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the tokenizer variable actually holds the full processor (as indicated by processor = tokenizer in the data collator), passing tokenizer directly to processing_class is highly recommended. If you only pass tokenizer.feature_extractor, the trainer will only save the feature extractor configuration (preprocessor_config.json) and will omit the tokenizer configuration files (like tokenizer_config.json, vocab.json, etc.) when trainer.save_model() is called. Passing the full processor ensures that both the feature extractor and tokenizer are properly saved, making the saved model fully self-contained and ready for inference or resuming training.

Suggested change
" processing_class = tokenizer.feature_extractor,\n",
" processing_class = tokenizer,\\n",

" compute_metrics = compute_metrics,\n",
" args = Seq2SeqTrainingArguments(\n",
" # predict_with_generate = True,\n",
Expand Down
2 changes: 1 addition & 1 deletion original_template/Whisper.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@
" train_dataset = train_dataset,\n",
" data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor=tokenizer),\n",
" eval_dataset = test_dataset,\n",
" tokenizer = tokenizer.feature_extractor,\n",
" processing_class = tokenizer.feature_extractor,\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the tokenizer variable actually holds the full processor (as indicated by processor = tokenizer in the data collator), passing tokenizer directly to processing_class is highly recommended. If you only pass tokenizer.feature_extractor, the trainer will only save the feature extractor configuration (preprocessor_config.json) and will omit the tokenizer configuration files (like tokenizer_config.json, vocab.json, etc.) when trainer.save_model() is called. Passing the full processor ensures that both the feature extractor and tokenizer are properly saved, making the saved model fully self-contained and ready for inference or resuming training.

Suggested change
" processing_class = tokenizer.feature_extractor,\n",
" processing_class = tokenizer,\\n",

" compute_metrics=compute_metrics,\n",
" args = Seq2SeqTrainingArguments(\n",
" # predict_with_generate=True,\n",
Expand Down
2 changes: 1 addition & 1 deletion python_scripts/Kaggle-Whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def __call__(self, features: List[Dict[str, Union[List[int], torch.Tensor]]]) ->
train_dataset = train_dataset,
data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor = tokenizer),
eval_dataset = test_dataset,
tokenizer = tokenizer.feature_extractor,
processing_class = tokenizer.feature_extractor,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the tokenizer variable actually holds the full processor (as indicated by processor = tokenizer in the data collator), passing tokenizer directly to processing_class is highly recommended. If you only pass tokenizer.feature_extractor, the trainer will only save the feature extractor configuration (preprocessor_config.json) and will omit the tokenizer configuration files (like tokenizer_config.json, vocab.json, etc.) when trainer.save_model() is called. Passing the full processor ensures that both the feature extractor and tokenizer are properly saved, making the saved model fully self-contained and ready for inference or resuming training.

Suggested change
processing_class = tokenizer.feature_extractor,
processing_class = tokenizer,

compute_metrics = compute_metrics,
args = Seq2SeqTrainingArguments(
# predict_with_generate = True,
Expand Down
2 changes: 1 addition & 1 deletion python_scripts/Whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def __call__(self, features: List[Dict[str, Union[List[int], torch.Tensor]]]) ->
train_dataset = train_dataset,
data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor = tokenizer),
eval_dataset = test_dataset,
tokenizer = tokenizer.feature_extractor,
processing_class = tokenizer.feature_extractor,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the tokenizer variable actually holds the full processor (as indicated by processor = tokenizer in the data collator), passing tokenizer directly to processing_class is highly recommended. If you only pass tokenizer.feature_extractor, the trainer will only save the feature extractor configuration (preprocessor_config.json) and will omit the tokenizer configuration files (like tokenizer_config.json, vocab.json, etc.) when trainer.save_model() is called. Passing the full processor ensures that both the feature extractor and tokenizer are properly saved, making the saved model fully self-contained and ready for inference or resuming training.

Suggested change
processing_class = tokenizer.feature_extractor,
processing_class = tokenizer,

compute_metrics = compute_metrics,
args = Seq2SeqTrainingArguments(
# predict_with_generate = True,
Expand Down
Loading