shashank-gv / hugging

0 stars 0 forks source link

Does hugging face repository require authentication? #2

Closed gjwgit closed 2 years ago

gjwgit commented 2 years ago
$ python summ.py microsoft_text.txt 

Traceback (most recent call last):
  File "/home/gjw/.local/lib/python3.10/site-packages/transformers/configuration_utils.py", line 616, in _get_config_dict
    resolved_config_file = cached_path(
  File "/home/gjw/.local/lib/python3.10/site-packages/transformers/utils/hub.py", line 284, in cached_path
    output_path = get_from_cache(
  File "/home/gjw/.local/lib/python3.10/site-packages/transformers/utils/hub.py", line 502, in get_from_cache
    _raise_for_status(r)
  File "/home/gjw/.local/lib/python3.10/site-packages/transformers/utils/hub.py", line 417, in _raise_for_status
    raise RepositoryNotFoundError(
transformers.utils.hub.RepositoryNotFoundError: 401 Client Error: Repository not found for url: https://huggingface.co/summarizer_t5small.mdl/resolve/main/config.json. If the repo is private, make sure you are authenticated.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gjw/git/github/shashank-gv/summarize/summ.py", line 40, in <module>
    summarizer = pipeline("summarization", model="summarizer_t5small.mdl")
  File "/home/gjw/.local/lib/python3.10/site-packages/transformers/pipelines/__init__.py", line 574, in pipeline
    config = AutoConfig.from_pretrained(model, _from_pipeline=task, **hub_kwargs, **model_kwargs)
  File "/home/gjw/.local/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 725, in from_pretrained
    config_dict, _ = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/gjw/.local/lib/python3.10/site-packages/transformers/configuration_utils.py", line 561, in get_config_dict
    config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/gjw/.local/lib/python3.10/site-packages/transformers/configuration_utils.py", line 628, in _get_config_dict
    raise EnvironmentError(
OSError: summarizer_t5small.mdl is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with `use_auth_token` or log in with `huggingface-cli login` and pass `use_auth_token=True`.
shashank-gv commented 2 years ago

This was due to the model being too large to upload on github (I was manually cd-ing it to ../.mlhub/). I have changed it to default to a download of t5-small while I figure out the best way to optimize retrieving the model.

gjwgit commented 2 years ago

Now works. Thanks. Just a bit noisey.