Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

从git repo启动 从huggingface下载东西时http401错误 #21

Open
jokester opened this issue May 22, 2023 · 1 comment
Open

从git repo启动 从huggingface下载东西时http401错误 #21

jokester opened this issue May 22, 2023 · 1 comment

Comments

@jokester
Copy link

我用的Linux, 这是我git clone后的各种设置:

  • 用python3.9创建venv (python3.9是conda的)
  • venv/bin/pip install -r requirements.txt
  • venv/bin/huggingface-cli login

运行 venv/bin/python main.py 后能看到UI窗口, 然后终端报下列错误, 程序结束

% venv/bin/python main.py 
Traceback (most recent call last):
  File "/home/dev/ML/comic-translation/venv/lib/python3.9/site-packages/transformers/feature_extraction_utils.py", line 404, in get_feature_extractor_dict
    resolved_feature_extractor_file = cached_path(
  File "/home/dev/ML/comic-translation/venv/lib/python3.9/site-packages/transformers/file_utils.py", line 1921, in cached_path
    output_path = get_from_cache(
  File "/home/dev/ML/comic-translation/venv/lib/python3.9/site-packages/transformers/file_utils.py", line 2125, in get_from_cache
    _raise_for_status(r)
  File "/home/dev/ML/comic-translation/venv/lib/python3.9/site-packages/transformers/file_utils.py", line 2052, in _raise_for_status
    request.raise_for_status()
  File "/home/dev/ML/comic-translation/venv/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/.%5Cmanga_ocr%5Cmodel/resolve/main/preprocessor_config.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dev/ML/comic-translation/main.py", line 966, in config_read
    self.change_mod(self.var.img_language)
  File "/home/dev/ML/comic-translation/main.py", line 258, in change_mod
    thread_language = threading.Thread(target=self.thread_language('ja'))
  File "/home/dev/ML/comic-translation/main.py", line 273, in thread_language
    self.memory.model = MangaOcr()
  File "/home/dev/ML/comic-translation/manga_ocr/ocr.py", line 14, in __init__
    self.feature_extractor = AutoFeatureExtractor.from_pretrained(pretrained_model_name_or_path)
  File "/home/dev/ML/comic-translation/venv/lib/python3.9/site-packages/transformers/models/auto/feature_extraction_auto.py", line 261, in from_pretrained
    config_dict, _ = FeatureExtractionMixin.get_feature_extractor_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/dev/ML/comic-translation/venv/lib/python3.9/site-packages/transformers/feature_extraction_utils.py", line 433, in get_feature_extractor_dict
    raise EnvironmentError(
OSError: We couldn't connect to 'https://huggingface.co/' to load this model and it looks like .\manga_ocr\model is not the path to a directory conaining a preprocessor_config.json file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
[1]    25063 IOT instruction (core dumped)  venv/bin/python main.py

@dtlnor
Copy link

dtlnor commented Aug 11, 2023

Unauthorized,你需要登录并输入hugging face的token才可以下载

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants