RASA NLU Paraphrasing

I am trying to use the rasa paraphrasing experimental feature but I got this error.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-155149dc867d> in <module>()
----> 1 from model import ParaphraseModel
      2 model_path = 'package_models/lm_finetune_8/checkpoint-56000/'
      3 
      4 complete_td = TrainingData()
      5 model = ParaphraseModel(model_path)

1 frames
/content/model.py in <genexpr>(.0)
     15 MAX_LENGTH = int(10000)  # Hardcoded max length to avoid infinite loop
     16 
---> 17 ALL_MODELS = sum((tuple(conf.pretrained_config_archive_map.keys()) for conf in (GPT2Config, OpenAIGPTConfig)), ())
     18 
     19 MODEL_CLASSES = {

AttributeError: type object 'GPT2Config' has no attribute 'pretrained_config_archive_map'

It’s due to some changes in HF transformer source code. If you go to the models.py file included in the notebook and change ALL_MODELS to:

ALL_MODELS = sum((conf for conf in (GPT2Config.get_config_dict("gpt2"), OpenAIGPTConfig.get_config_dict("openai-gpt"))), ())

  • for gpt2 you can use the following weights: “gpt2”, “gpt2-medium”, “gpt2-large”, “gpt2-xl”, “distilgpt2”
2 Likes

Thanks, this worked perfectly.

Hi, I am facing the same issue. Can you please share the path of this ‘models.py’ file? I am unable to locate it.