ohmeow / blurr

A library that integrates huggingface transformers with the world of fastai, giving fastai devs everything they need to train, evaluate, and deploy transformer specific models.
https://ohmeow.github.io/blurr
Apache License 2.0
289 stars 34 forks source link

Notebook error: "NameError: name 'HF_MODELS' is not defined #7

Closed boxabirds closed 4 years ago

boxabirds commented 4 years ago

I'm running the blurr notebook and hit an error that I'd love some help with:

pretrained_model_name = "bart-large-cnn"

hf_arch, hf_tokenizer, hf_config, hf_model = \
    BLURR_MODEL_HELPER.get_hf_objects(pretrained_model_name, BartTokenizer, HF_MODELS.BartForConditionalGeneration)

hf_arch, type(hf_tokenizer), type(hf_config), type(hf_model)

Error

NameError                                 Traceback (most recent call last)
<ipython-input-8-39f983a4d82d> in <module>()
      1 pretrained_model_name = "bart-large-cnn"
      2 
----> 3 hf_arch, hf_tokenizer, hf_config, hf_model =     BLURR_MODEL_HELPER.get_hf_objects(pretrained_model_name, BartTokenizer, HF_MODELS.BartForConditionalGeneration)
      4 
      5 hf_arch, type(hf_tokenizer), type(hf_config), type(hf_model)

NameError: name 'HF_MODELS' is not defined

I spent some time trying to understand the code and find reference to this but I came up short. I'm presuming the notebook is out of date and there's a new way to call get_hf_objects?

ohmeow commented 4 years ago

You are correct.

See here for an updated example on how to use BART for summarization: https://ohmeow.github.io/blurr/data-text-generation/

(btw, things will probably be changing a bit here and there until a version 1 ... but I try to keep the docs at least updated for the time being :) )

boxabirds commented 4 years ago

Thanks! Yes I saw the warning, no problem at all. Not urgent