Fix uploading processors/tokenizers to WandB on train end#35701
Fix uploading processors/tokenizers to WandB on train end#35701ArthurZucker merged 2 commits intohuggingface:mainfrom jack89roberts:bugfix/wandb-callback-save-processor
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. |
SunMarc
left a comment
There was a problem hiding this comment.
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 |
ArthurZucker
left a comment
There was a problem hiding this comment.
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
tokenizerwas renamed toprocessing_classin #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-classificationonmainand this branch, and comparing the artifacts logged to your wandb run (you'll need to delete the local output directoryrm -rf /tmp/mrpcbefore starting the script on each branch):The files in the logged
:latestmodel 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.