-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Fix uploading processors/tokenizers to WandB on train end #35701
Fix uploading processors/tokenizers to WandB on train end #35701
Conversation
Edit: Passed after the 2nd commit so I suspect it was some unlucky randomness in the tests? |
Looking at the rest of |
Hey @jack89roberts, I am from W&B. Thanks for opening this PR. LGTM. :) |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this is something we missed from the PR you mentioned. We need to have this change since we have the following in CallbackHandler
def call_event(self, event, args, state, control, **kwargs):
for callback in self.callbacks:
result = getattr(callback, event)(
args,
state,
control,
model=self.model,
processing_class=self.processing_class,
optimizer=self.optimizer,
lr_scheduler=self.lr_scheduler,
train_dataloader=self.train_dataloader,
eval_dataloader=self.eval_dataloader,
**kwargs,
)
# A Callback can skip the return of `control` if it doesn't change it.
if result is not None:
control = result
return control
Hi, sorry to prod but is there anything I can do to help this get merged/make sure it doesn't get forgotten about? It's stopping us from using transformers >=4.46.0. |
Hi @jack89roberts, sorry for the delay we are just waiting for the review of a core maintainer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow sorry and thanks all for the update! INdeed we changed the api I think 2-3 month ago!
Thanks! |
…e#35701) * rename tokenizer to processing_class in WandbCallback.on_train_end * rename tokenizer to processing_class in ClearMLCallback and DVCLiveCallback
…e#35701) * rename tokenizer to processing_class in WandbCallback.on_train_end * rename tokenizer to processing_class in ClearMLCallback and DVCLiveCallback
What does this PR do?
Since
tokenizer
was renamed toprocessing_class
in #32385 models uploaded to WandB at the end of training have not included the tokenizer/processor config. This is due to a missed update to the argument names inWandbCallback.on_train_end
, which is fixed in this PR. The bug has only impacted the final artifacts saved at the end of training, checkpoints saved during training still upload both the model and the processor config.If you have wandb setup and logged in you can see the problem by running
examples/pytorch/text-classification
onmain
and this branch, and comparing the artifacts logged to your wandb run (you'll need to delete the local output directoryrm -rf /tmp/mrpc
before starting the script on each branch):The files in the logged
:latest
model artifact in your run will include the tokenizer config for the run from this branch, but not in the run started on main.Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
Previous changes: @amyeroberts
Maybe Trainer: @muellerzr, @SunMarc , though this is more an integration/WandB issue.