another way to use shift_labels#38533
Conversation
|
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. |
| loss = None | ||
| if labels is not None: | ||
| loss = self.loss_function(logits=logits, labels=labels, vocab_size=self.config.vocab_size, **kwargs) |
There was a problem hiding this comment.
We still need to change in many modeling files, but at least it's more clean than in #37993
There was a problem hiding this comment.
@ArthurZucker if you are happy with this, I will apply the changes to other files.
There was a problem hiding this comment.
its alright but it creates an indirection! TBH i'd rather we check labels is not None or "shit_labels" in kwargs
ArthurZucker
left a comment
There was a problem hiding this comment.
thanks and sorry for the back and forth
| loss = None | ||
| if labels is not None: | ||
| loss = self.loss_function(logits=logits, labels=labels, vocab_size=self.config.vocab_size, **kwargs) |
There was a problem hiding this comment.
its alright but it creates an indirection! TBH i'd rather we check labels is not None or "shit_labels" in kwargs
|
No worry I will hold on as you mentioned there is a WIP PR #39047 |
What does this PR do?