-
Notifications
You must be signed in to change notification settings - Fork 28k
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
deepcopy added in pipeline, breaks anything that worked before that used Rlock etc. like streaming generation #23785
Comments
@pseudotensor you closed this without a comment. Is this issue still relevant ? |
Github trying to be too smart with separate issue in another repo |
TIL "The dictionary itself is passed in as **generate_kwargs and any mutation to the dictionary itself has no effect on the parent dictionary or items passed in." In that case you're right, no copy is needed at all! |
@pseudotensor should be fixed now (closing the issue, but feel free to reopen if you find further related issues) |
System Info
transformers==4.29.2
python 3.10
Who can help?
@gante @Narsil
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Due to this change by @gante:
b369e50
This is a fully blocking change for me. I cannot upgrade to new transformers since this change because this breaks streaming scenario.
Expected behavior
I don't think copy.deepcopy() is appropriate. The dictionary itself is passed in as **generate_kwargs and any mutation to the dictionary itself has no effect on the parent dictionary or items passed in.
Additionally, the modifications made to the dictionary in that changed code only involve entries within the dictionary, not to mutable items inside the dictionary, so none of those changes would have any effect to any other block of code.
A simple shallow copy is sufficient.
But additionally, I can't see any reason for any copy at all. Changes to the dictionary locally have no effect anywhere else.
The text was updated successfully, but these errors were encountered: