-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
[AutoModel] Add AutoModelForTextEncoding #24305
[AutoModel] Add AutoModelForTextEncoding #24305
Conversation
@@ -1011,6 +1011,36 @@ | |||
] | |||
) | |||
|
|||
MODEL_FOR_TEXT_ENCODING_MAPPING_NAMES = OrderedDict( |
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.
Is this list good for you @amyeroberts? It's the most popular encoder-only architectures, and enc-dec ones where we have the encoder model separated as an import
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.
Yep! We can always add as needed :)
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.
Thanks for adding!
Just a comment on some potential missing imports for TF model in the init
@@ -1011,6 +1011,36 @@ | |||
] | |||
) | |||
|
|||
MODEL_FOR_TEXT_ENCODING_MAPPING_NAMES = OrderedDict( |
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.
Yep! We can always add as needed :)
@@ -716,6 +716,13 @@ def __init__(self, *args, **kwargs): | |||
requires_backends(self, ["torch"]) | |||
|
|||
|
|||
class AutoModelForTextEncoding(metaclass=DummyObject): |
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 should be the equivalent TFAutoModelForTextEncoding
in dummy_tf_objects.py
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.
Ah perfect! Thanks for flagging! Resolved in 8b003f7
@@ -1084,6 +1084,7 @@ | |||
"AutoModelForSequenceClassification", | |||
"AutoModelForSpeechSeq2Seq", | |||
"AutoModelForTableQuestionAnswering", | |||
"AutoModelForTextEncoding", |
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.
The TF equivalent class should be in this init too
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.
Resolved in 8b003f7
The documentation is not available anymore as the PR was closed or merged. |
ebfc908
to
adc7782
Compare
What does this PR do?
Adds AutoModel for text encoding (used in the circumstance when you want to extract the text encoder from an encoder-decoder architecture).
This facilitates loading a t5 encoder from t5 enc-dec model weights (as is done in Music Gen in #24109)