-
Notifications
You must be signed in to change notification settings - Fork 27.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASR example doesn't save tokenizer settings #23222
Comments
The comment on |
When I replace these lines at the end of if training_args.push_to_hub:
trainer.push_to_hub(**kwargs)
else:
trainer.create_model_card(**kwargs) to this: tokenizer.save_pretrained(training_args.output_dir)
trainer.create_model_card(**kwargs)
if training_args.push_to_hub:
trainer.push_to_hub(**kwargs) we do get tokenizer files. Also, may as well write the model card in any case. |
The code in the trainer = Trainer(
...
tokenizer=processor.feature_extractor,
...
) The "processor" combines the feature extractor and tokenizer into a single class, but because we only pass the feature extractor to the Trainer, the tokenizer doesn't get saved. So that's clearly a mistake on our end. The following fix should work: trainer = Trainer(
...
tokenizer=processor,
...
) We're updating the docs to fix this. (It's a bit confusing that this argument from Trainer is called |
Probably we can directly add a new argument to the trainer = Trainer(
...
processor=processor,
...
) Here we could expect the user to pass either one of |
Can confirm, setting |
Keeping this open since we really should update the Trainer to take |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
System Info
transformers
version: 4.28.1Who can help?
@sgugger
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Run training using run_speech_recognition_ctc.py and the included json file.
train.json.zip
Next, attempt to infer using the trained model:
Output:
Checking the uploaded repo, it seems that no tokenizer-related files (e.g.
vocab.json
,tokenizer_config.json
, etc) were pushed.I added some debug to
run_speech_recognition_ctc.py
and found that these files were generated locally, but got deleted locally during step 7 whenTrainer
was initialized (line 701).The output from
run_speech_recognition_ctc.py
at that point was:It seems that instantiating
Training
withpush_to_hub=true
creates a new repo and then empties anything in the local directory so that it can clone the repo into it. This deletes any files written to the local directory, which includes the tokenizer configs.Expected behavior
No error.
The text was updated successfully, but these errors were encountered: