Cannot find the requested files in the cached path.
See original GitHub issueWithout internet connection, running MangaOcr
returns this error:
File "manga_ocr\ocr.py", line 15, in __init__
self.tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path)
File "transformers\models\auto\tokenization_auto.py", line 528, in from_pretrained
return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
File "transformers\tokenization_utils_base.py", line 1732, in from_pretrained
user_agent=user_agent,
File "transformers\file_utils.py", line 1929, in cached_path
local_files_only=local_files_only,
File "transformers\file_utils.py", line 2178, in get_from_cache
"Connection error, and we cannot find the requested files in the cached path."
ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.
I’m sure the first time I ran MangaOcr
, it downloaded the pretrained model, but it seems it can’t find it. Where was the model saved at? I’ve search around but no luck. I’m using python with anaconda on Windows 10.
And anyway, thanks for the work. Does its job flawlessly.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
"Connection error, and we cannot find the requested files in ...
I am trying to execute this command after installing all the required modules and I ran into this error: NOTE : We are...
Read more >HuggingFace | ValueError: Connection error, and we cannot ...
HuggingFace | ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your ......
Read more >Value error : Connection error - Transformers
but I get this error: ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or...
Read more >HuggingFace | ValueError: Connection error, and we cannot ...
Coding example for the question HuggingFace | ValueError: Connection error, and we cannot find the requested files in the cached path.
Read more >Problem Loading Distil Bert | Data Science and ... - Kaggle
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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you very much, setting the env variable solves the problem. Also cuts down on loading times: from 10 seconds to 2! No more issues after this.
Huh, to be honest I thought it’d work out of the box, but apparently transformers need to be explicitly told to use offline cache: https://huggingface.co/docs/transformers/installation#offline-mode
So, there are two options:
TRANSFORMERS_OFFLINE=1
and run normally (it should use cache).or
pretrained_model_name_or_path
parameter.