首页 最新 热门 推荐

  • 首页
  • 最新
  • 热门
  • 推荐

open-webui报错Connection to huggingface.co timed out.

  • 25-02-19 14:20
  • 2712
  • 11364
blog.csdn.net

总结:huggingface不能用,直接设置镜像:

HF_ENDPOINT=https://hf-mirror.com

缘起

随着大家纷纷复工,一些网站又恢复了以前不能用的状态,比如open-webui前几天还能用,现在就报错:

  File "E:\py311\Lib\site-packages\urllib3\util\retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/sentence-transformers/all-MiniLM-L6-v2/revision/main (Caused by ConnectTimeoutError(, 'Connection to huggingface.co timed out. (connect timeout=None)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\py311\Lib\site-packages\huggingface_hub\_snapshot_download.py", line 155, in snapshot_download
    repo_info = api.repo_info(repo_id=repo_id, repo_type=repo_type, revision=revision, token=token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\py311\Lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "E:\py311\Lib\site-packages\huggingface_hub\hf_api.py", line 2704, in repo_info
    return method(
           ^^^^^^^
  File "E:\py311\Lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "E:\py311\Lib\site-packages\huggingface_hub\hf_api.py", line 2488, in model_info
    r = get_session().get(path, headers=headers, timeout=timeout, params=params)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\py311\Lib\site-packages\requests\sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\py311\Lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\py311\Lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\py311\Lib\site-packages\huggingface_hub\utils\_http.py", line 93, in send
    return super().send(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\py311\Lib\site-packages\requests\adapters.py", line 688, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/sentence-transformers/all-MiniLM-L6-v2/revision/main (Caused by ConnectTimeoutError(, 'Connection to huggingface.co timed out. (connect timeout=None)'))"), '(Request ID: 3f54bc76-7b85-4a85-ae98-0ecc3f5b2430)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:\py311\Lib\site-packages\open_webui\retrieval\utils.py", line 417, in get_model_path
    model_repo_path = snapshot_download(**snapshot_kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\py311\Lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "E:\py311\Lib\site-packages\huggingface_hub\_snapshot_download.py", line 235, in snapshot_download
    raise LocalEntryNotFoundError(
huggingface_hub.errors.LocalEntryNotFoundError: An error happened while trying to locate the files on the Hub and we cannot find the appropriate snapshot folder for the specified revision on the local disk. Please check your internet connection and try again.
WARNI [sentence_transformers.SentenceTransformer] No sentence-transformers model found with name sentence-transformers/all-MiniLM-L6-v2. Creating a new one with mean pooling.

解决方法:

设置环境变量

Windows设置环境变量的方法

找到桌面的“我的电脑”图标,右键,选属性,选择“高级系统设置”,然后点击“环境变量”,就可以修改环境变量了。也可以通过开始菜单的“设置”-“系统”-“关于”--“高级系统设置”,找到“环境变量”设置按钮。

然后加入一个环境变量,名字:HF_ENDPOINT 内容:https://hf-mirror.com

重新开一个控制台终端,启动:
 

open-webui serve

v0.5.7 - building the best open-source AI user interface.

https://github.com/open-webui/open-webui

1_Pooling/config.json: 100%|██████████████████████████████████████████████████████████████████| 190/190 [00:00 modules.json: 100%|███████████████████████████████████████████████████████████████████████████| 349/349 [00:00 config_sentence_transformers.json: 100%|██████████████████████████████████████████████████████| 116/116 [00:00 config.json: 612B [00:00, ?B/s]
.gitattributes: 1.23kB [00:00, ?B/s]
data_config.json: 39.3kB [00:00, ?B/s]                                                       | 0.00/199 [00:00 README.md: 10.7kB [00:00, ?B/s] ?B/s]
Fetching 30 files:   0%|                                                                        | 0/30 [00:04 E:\py311\Lib\site-packages\huggingface_hub\file_download.py:140: UserWarning: `huggingface_hub` cache-system uses symlinks by default to efficiently store duplicated files but your machine does not support them in C:\Users\Admin\.cache\huggingface\hub\models--sentence-transformers--all-MiniLM-L6-v2. Caching files will still work but in a degraded version that might require more space on your disk. This warning can be disabled by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. For more details, see https://huggingface.co/docs/huggingface_hub/how-to-cache#limitations.
To support symlinks on Windows, you either need to activate Developer Mode or to run Python as an administrator. In order to activate developer mode, see this article: https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development
  warnings.warn(message)
model.safetensors: 100%|██████████████████████████████████████████████████████████| 90.9M/90.9M [00:17<00:00, 5.26MB/s]
model_O2.onnx: 100%|██████████████████████████████████████████████████████████████| 90.3M/90.3M [00:31<00:00, 2.86MB/s]
model_O3.onnx: 100%|██████████████████████████████████████████████████████████████| 90.3M/90.3M [00:33<00:00, 2.68MB/s]
model.onnx: 100%|█████████████████████████████████████████████████████████████████| 90.4M/90.4M [00:34<00:00, 2.64MB/s]
model_O1.onnx: 100%|██████████████████████████████████████████████████████████████| 90.4M/90.4M [00:36<00:00, 2.51MB/s]

 

就自动到huggingface镜像网站下载东西了。问题解决!

注:本文转载自blog.csdn.net的skywalk8163的文章"https://blog.csdn.net/skywalk8163/article/details/145427911"。版权归原作者所有,此博客不拥有其著作权,亦不承担相应法律责任。如有侵权,请联系我们删除。
复制链接
复制链接
相关推荐
发表评论
登录后才能发表评论和回复 注册

/ 登录

评论记录:

未查询到任何数据!
回复评论:

分类栏目

后端 (14832) 前端 (14280) 移动开发 (3760) 编程语言 (3851) Java (3904) Python (3298) 人工智能 (10119) AIGC (2810) 大数据 (3499) 数据库 (3945) 数据结构与算法 (3757) 音视频 (2669) 云原生 (3145) 云平台 (2965) 前沿技术 (2993) 开源 (2160) 小程序 (2860) 运维 (2533) 服务器 (2698) 操作系统 (2325) 硬件开发 (2492) 嵌入式 (2955) 微软技术 (2769) 软件工程 (2056) 测试 (2865) 网络空间安全 (2948) 网络与通信 (2797) 用户体验设计 (2592) 学习和成长 (2593) 搜索 (2744) 开发工具 (7108) 游戏 (2829) HarmonyOS (2935) 区块链 (2782) 数学 (3112) 3C硬件 (2759) 资讯 (2909) Android (4709) iOS (1850) 代码人生 (3043) 阅读 (2841)

热门文章

130
用户体验设计
关于我们 隐私政策 免责声明 联系我们
Copyright © 2020-2024 蚁人论坛 (iYenn.com) All Rights Reserved.
Scroll to Top