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

Load Huggingface Transformers model using TFAutoModel #6307

Closed
4 tasks
patricebechard opened this issue Jul 31, 2020 · 10 comments
Closed
4 tasks

Load Huggingface Transformers model using TFAutoModel #6307

patricebechard opened this issue Jul 31, 2020 · 10 comments
Assignees
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss/ml/nlu-components Issues focused around rasa's NLU components type:discussion 👨‍👧‍👦 Early stage of an idea or validation of thoughts. Should NOT be closed by PR. type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR

Comments

@patricebechard
Copy link

patricebechard commented Jul 31, 2020

Description of Problem: I want to use models provided by the HuggingFace transformers library that are not available when using the HFTransformersNLP Component.

Overview of the Solution: Right now, models are loaded using a dictionary of architectures in rasa/nlu/utils/hugging_face/registry.py. Using the AutoModel and AutoTokenizer features from the transformers library, we can get rid of these limitations, as well as not having to define a model_name in the config file. We can only use the model_weights info to select the proper model and weights of the wanted tokenizers and featurizers.

Examples (if relevant): Docs for how to use the "auto" features is available here

Blockers (if relevant):

Definition of Done:

  • Changes are made to files in rasa/rasa/nlu/utils/hugging_face/
  • Tests are added
  • Feature described the docs
  • Feature mentioned in the changelog
@patricebechard patricebechard added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR labels Jul 31, 2020
@sara-tagger
Copy link
Collaborator

sara-tagger commented Jul 31, 2020

Exalate commented:

sara-tagger commented:

Thanks for submitting this feature request

🚀
@JustinaPetr will get back to you about it soon!


@ftarlaci
Copy link

ftarlaci commented Nov 4, 2020

Exalate commented:

ftarlaci commented:

Hi,

Is there any update on this enhancement? I would also like to use some of HF models that are currently not available in the HFTransformersNLP Component. Thank you!

@dakshvar22
Copy link
Contributor

dakshvar22 commented Nov 9, 2020

Exalate commented:

dakshvar22 commented:

The reason for not being able to use AutoModel and AutoTokenizer is because of a few implementation details on how HFTransformersNLP is interacting with the rest of the pipeline in Rasa Open Source. I would be curious to know what kind of models are you folks trying to use which are currently not supported.

@patricebechard
Copy link
Author

patricebechard commented Nov 12, 2020

Exalate commented:

patricebechard commented:

Hi @dakshvar22,

We were interested in looking into french models (FlauBERT, CamemBERT) for our project. Pretrained weights for these models are not available through the normal BertModel provided by HuggingFace, which was the main blocker on our side. We did some experimentation with the multilingual models, but they tend not to perform really well compared to french-only models. Instead of enabling only these specific models within HFTransformersNLP, we figured it would be best to have a more general way of dealing with models from the transformers library.

@dakshvar22
Copy link
Contributor

dakshvar22 commented Nov 12, 2020

Exalate commented:

dakshvar22 commented:

Thanks for the info @patricebechard . Are you looking at them for intent classification and entity recognition or some other tasks? We recently changed the default model weights that HFTransformersNLP uses. We now use a language agnostic model which gives much better sentence representations. This change will be part of the upcoming 2.1 release. I'll encourage you to try that as well.

@joejuzl joejuzl added area:rasa-oss/ml/nlu-components Issues focused around rasa's NLU components type:discussion 👨‍👧‍👦 Early stage of an idea or validation of thoughts. Should NOT be closed by PR. labels Jan 28, 2021
@Ghostvv
Copy link
Contributor

Ghostvv commented Feb 12, 2021

Exalate commented:

Ghostvv commented:

@dakshvar22 if we cannot use auto model, shall we close the issue?

@dakshvar22
Copy link
Contributor

dakshvar22 commented Feb 12, 2021

Exalate commented:

dakshvar22 commented:

The plan is to review this once we update the transformers dependency. Once we are sure that it is not possible to use auto model with the latest dependencies as well, we should close this issue.

@Ghostvv
Copy link
Contributor

Ghostvv commented Feb 12, 2021

Exalate commented:

Ghostvv commented:

shall we move it to blocked then?

@mleimeister
Copy link
Contributor

mleimeister commented Jan 7, 2022

Exalate commented:

mleimeister commented:

@TyDunn Just to raise it to your awareness, I've started a side project to explore this. The current state is here: #10624

If I get to a point where it looks viable, I can check with Enable how this would play together with the scheduled TF/transformers upgrade.

@mleimeister mleimeister self-assigned this Jan 24, 2022
@mleimeister mleimeister linked a pull request Jan 24, 2022 that will close this issue
13 tasks
@rasabot-exalate rasabot-exalate added area:rasa-oss type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR and removed type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR type:discussion 👨‍👧‍👦 Early stage of an idea or validation of thoughts. Should NOT be closed by PR. area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss labels Mar 17, 2022 — with Exalate Issue Sync
@rasabot-exalate rasabot-exalate added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:discussion 👨‍👧‍👦 Early stage of an idea or validation of thoughts. Should NOT be closed by PR. type:enhancement_:sparkles: type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR and removed area:rasa-oss :ferris wheel: labels Mar 17, 2022 — with Exalate Issue Sync
@sync-by-unito
Copy link

sync-by-unito bot commented Dec 19, 2022

➤ Maxime Verger commented:

💡 Heads up! We're moving issues to Jira: https://rasa-open-source.atlassian.net/browse/OSS.

From now on, this Jira board is the place where you can browse (without an account) and create issues (you'll need a free Jira account for that). This GitHub issue has already been migrated to Jira and will be closed on January 9th, 2023. Do not forget to subscribe to the corresponding Jira issue!

➡️ More information in the forum: https://forum.rasa.com/t/migration-of-rasa-oss-issues-to-jira/56569.

@m-vdb m-vdb closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss/ml/nlu-components Issues focused around rasa's NLU components type:discussion 👨‍👧‍👦 Early stage of an idea or validation of thoughts. Should NOT be closed by PR. type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants