2

I'm trying to configure Rasa to use models pretrained at HuggingFace. This is my setup

language: fr
pipeline:
    - name: LanguageModelTokenizer
    - name: LanguageModelFeaturizer
      model_name: "bert"
      model_weights: "setu4993/LaBSE"
      cache_dir: "/rasa/model"

The HuggingFace model is here

After I run “rasa train”, it says OSError: Model name “setu4993/LaBSE” was not found. Any idea how to integrate this huggingface model to Rasa?

Can we include multiple HuggingFace pipeline in Rasa configuration? Example

pipeline:
    - model_name: "bert"
...
    - model_name: "xlnet"
Bih Cheng
  • 655
  • 1
  • 13
  • 28

1 Answers1

3

In order to use HuggingFace Transformers in your pipeline in your config.yml file, you have to do the following:

  1. run the following in your terminal pip install rasa[transformers] --use-feature=2020-solver
  2. in your config.yml file you add the following:
    - name: HFTransformersNLP
      model_name: "bert" # Name of the language model to use
      model_weights: "rasa/LaBSE" # Pre-Trained weights to be loaded
    - name: LanguageModelTokenizer
    - name: LanguageModelFeaturizer
    
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
ElSheikh
  • 321
  • 6
  • 28
  • InvalidConfigException: Can't load class for name 'HFTransformersNLP'. Please make sure to provide a valid name or module path and to register it using the '@DefaultV1Recipe.register' decorator. – Hack-R Mar 28 '23 at 20:04