Skip to content
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

Add XGLM models #14876

Merged
merged 49 commits into from Jan 28, 2022
Merged

Add XGLM models #14876

merged 49 commits into from Jan 28, 2022

Conversation

patil-suraj
Copy link
Contributor

What does this PR do?

This PR adds the XGLM model: code, paper

@patil-suraj patil-suraj changed the title Add XGLM models [WIP] Add XGLM models Dec 22, 2021
in social value tasks such as hate speech detection in five languages and find it has limitations similar to comparable sized GPT-3 models.*


This model was contributed by [Suraj](https://huggingface.co/valhalla). The original code can be found [here](https://github.com/pytorch/fairseq/tree/main/examples/xglm).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add some prompt examples here - but happy to do this in a follow-up PR

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks very clean to me already!

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for adding this new model!

docs/source/model_doc/xglm.mdx Outdated Show resolved Hide resolved
docs/source/model_doc/xglm.mdx Outdated Show resolved Hide resolved
src/transformers/__init__.py Outdated Show resolved Hide resolved
src/transformers/__init__.py Outdated Show resolved Hide resolved
src/transformers/__init__.py Outdated Show resolved Hide resolved
src/transformers/models/xglm/modeling_flax_xglm.py Outdated Show resolved Hide resolved
src/transformers/models/xglm/modeling_xglm.py Outdated Show resolved Hide resolved
src/transformers/models/xglm/modeling_xglm.py Outdated Show resolved Hide resolved
src/transformers/models/xglm/modeling_xglm.py Outdated Show resolved Hide resolved
tests/test_tokenization_xglm.py Outdated Show resolved Hide resolved
@patil-suraj patil-suraj changed the title [WIP] Add XGLM models Add XGLM models Dec 31, 2021
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks @patil-suraj!

@@ -910,6 +910,35 @@ def converted(self) -> Tokenizer:
return tokenizer


class XGLMConverter(SpmConverter):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

src/transformers/models/xglm/configuration_xglm.py Outdated Show resolved Hide resolved
for model_class_name in self.all_model_classes:
model = model_class_name.from_pretrained("facebook/xglm-564M")
outputs = model(np.ones((1, 1)))
self.assertIsNotNone(outputs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could there be an integration test here as well?

@huggingface huggingface deleted a comment from github-actions bot Jan 27, 2022
@patil-suraj patil-suraj added the WIP Label your PR/Issue with WIP for some long outstanding Issues/PRs that are work in progress label Jan 27, 2022
@patil-suraj patil-suraj merged commit d25e25e into huggingface:master Jan 28, 2022
@patil-suraj patil-suraj deleted the xglm branch January 28, 2022 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Label your PR/Issue with WIP for some long outstanding Issues/PRs that are work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants