hassonlab / 247-pickling

Contains code to create pickles from raw/processed data
1 stars 9 forks source link

Cannot load some hugging face models with local_files_only=True #61

Closed hvgazula closed 2 years ago

hvgazula commented 2 years ago

What is the issue? For example, if I cache a model using model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-neox-20b") and then trying to load it using model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-neox-20b", local_files_only=True) raises an OSError.

Other Models (for our use case):

For all the above models, cloning (using git lfs clone) the model repo works fine. However, doing this will lead to inconsistent methods (in scripts/tfsemb_download.py) for caching models. i.e. AutoModel*.from_pretrained and git clone model_name. For more info about these two modes, please refer to any model card in hugging face

hvgazula commented 2 years ago

Should we cache all models using git clone or should I create a separate list with models that need to be cloned? Thoughts? @VeritasJoker @miahong

hvgazula commented 2 years ago

https://github.com/hassonlab/247-pickling/pull/62

hvgazula commented 2 years ago

For more info please visit https://huggingface.co/docs/transformers/installation#offline-mode

miahong commented 2 years ago

I'm ok with both methods. does git clone every model cause a longer time? but it is a one-time thing right?

hvgazula commented 2 years ago

Yes, one time thing.

hvgazula commented 2 years ago

Closing for the time caching with both available methods. Will move to git lfs clone in the future.