Update forward's return introduction to indicate dict being returned by default
#1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Make it clear that the
forwardmethod now returns a dict instead of tuple.PR huggingface#8530 switch the default value of
return_dictin configurations toTrue. This caused some older code that relied onreturn_dictbeing set toFalseto break since assigned a dictionary to tuples can have unexpected outcomes such as receiving strings instead.The phrasing of the introduction under the return section of the
forwardmethod for all models currently state that a dictionary will be returned only ifreturn_dict=Trueis passed or thatconfig.return_dictis set toTrue. This is no longer valid ever since the default configuration changed, thus it will be beneficial for the readers to update this portion to indicate thatreturn_dict=Falseneeds to be passed to theforwardmethod orconfig.return_dictneeds to be set toFalsefor a tuple to be returned.This will likely save readers some time when adapting old code.