-
Notifications
You must be signed in to change notification settings - Fork 30.8k
🚨🚨🚨 Fix sdpa in sam and refactor relative position embeddings #36422
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
Changes from 11 commits
dea7503
400e948
c8d5f1c
7db2903
82e1b9f
f5f2ac5
41c191f
1c99b6c
99fc746
bf57971
14b98a7
622c992
df2e4a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -979,7 +979,7 @@ class MyProcessingKwargs(ProcessingKwargs, CommonKwargs, TextKwargs, ImagesKwarg | |
kwarg_value = kwargs.get(modality_key, "__empty__") | ||
else: | ||
kwarg_value = "__empty__" | ||
if kwarg_value != "__empty__": | ||
if not isinstance(kwarg_value, str) or kwarg_value != "__empty__": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wonder, why this was needed? Even if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change was necessary because tf.Variable([1, 2, 3, 4]) == "hello"
# TypeError: Cannot convert '__empty__' to EagerTensor of dtype int32 This issue occurred in the test suite There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. interesting, thanks for explanation |
||
output_kwargs[modality][modality_key] = kwarg_value | ||
used_keys.add(modality_key) | ||
|
||
|
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.
Why do we need ot add .numpy()?
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.
because tensorflow tensors don't have a direct
item()
method and to access the scalar value, we need to donumpy().item()
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.
ok! just wondering if it was broken before
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.
there are a bunch of other tensorflow bugs that I don't why didnot appear in the workflows before, except in #36493, and I have checked for different version of tensorflow they seem to be geniune bugs over all versions.
Uh oh!
There was an error while loading. Please reload this page.
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.
ok, not sure if there any usage of TF Sam actually, so there might be some bugs indeed!