question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

get_from_cache in file_utils.py gobbles up error in making url requests

See original GitHub issue

šŸ› Bug

No information from the package on SSL error encountered, making it difficult to troubleshoot or figure out a workaround

Information

When trying to do: TFAutoModelWithLMHead.from_pretrained("t5-small")

Get an error: TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

The above is a result of an SSL error encountered when trying to fetch the model, however, since the exception handling isnā€™t proper within file_utils.py I donā€™t come to know of it, unless I debug.

Model I am using (Bert, XLNet ā€¦): T5

Language I am using the model on (English, Chinese ā€¦): English

The problem arises when using:

  • [ x] the official example scripts: (give details below)
  • my own modified scripts: (give details below)

https://huggingface.co/transformers/usage.html#summarization

The tasks I am working on is:

  • an official GLUE/SQUaD task: (give the name)
  • [ x] my own task or dataset: (give details below) Just getting familiar with transformers for summarization

To reproduce

You need a machine with an expired certificate for proxy etc.

Steps to reproduce the behavior:

  1. See information above

Expected behavior

If there has been an issue in fetching the pre-trained model from s3 bucket etc. I should get an error to that effect.

Environment info

  • transformers version: 2.10.0
  • Platform: Windows 10
  • Python version: 3.7.4
  • PyTorch version (GPU?): NA
  • Tensorflow version (GPU?): 2.0.0 (Yes)
  • Using GPU in script?: No
  • Using distributed or parallel set-up in script?: No

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
julien-ccommented, Sep 24, 2020

Yes I want to track and solve that issue in the next couple of weeks.

0reactions
gcolmencommented, Feb 24, 2021

Hi @julien-c , Iā€™m having the same issue as @stadelmanma (Iā€™m behind a coporate proxy as well)

    config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/USER/anaconda3/envs/codebert/lib/python3.7/site-packages/transformers/configuration_utils.py", line 436, in get_config_dict
    raise EnvironmentError(msg)
OSError: Can't load config for 'microsoft/deberta-base'. Make sure that:

- 'microsoft/deberta-base' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'microsoft/deberta-base' is the correct path to a directory containing a config.json file

I even tried setting the proxy in proxies: config = config_class.from_pretrained(args.config_name, proxies={'http://': '<HOST>:<PORT>'})

But same thing happens. Maybe thereā€™s a workaround for this?

Many thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python request.get fails to get an answer for a url I can open ...
I'm learning how to use python requests (Python 3) and I am trying to make a simple requests.get to get the HTML code...
Read more >
connection issue Ā· Issue #8690 Ā· huggingface/transformers
ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connectionĀ ......
Read more >
requests-cache 0.9.7 documentation
requests -cache is a transparent, persistent cache that provides an easy way to get better performance with the python requests library.
Read more >
Caching External API Requests - Real Python
Learn how to to cache external API calls in your Python apps with the excellent "requests" module. This tutorial includes a full example...
Read more >
How Requests are Handled | App Engine standard ...
The following Python script responds to a request with an HTTP header and the ... In the Google Frontend, the cache key is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found