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.

Cannot find the requested files in the cached path.

See original GitHub issue

Without 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:closed
  • Created a year ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
blunderedbishopcommented, Apr 2, 2022

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.

0reactions
kha-whitecommented, Apr 1, 2022

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:

  1. Set environment variable TRANSFORMERS_OFFLINE=1 and run normally (it should use cache).

or

  1. Download model files from https://huggingface.co/kha-white/manga-ocr-base/tree/main and pass the path to folder containing these files as pretrained_model_name_or_path parameter.
Read more comments on GitHub >

github_iconTop 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 >

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