当前位置: 首页 > article >正文

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

总结: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(<urllib3.connection.HTTPSConnection object at 0x00000274C5F31590>, '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(<urllib3.connection.HTTPSConnection object at 0x00000274C5F31590>, '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<?, ?B/s]
modules.json: 100%|███████████████████████████████████████████████████████████████████████████| 349/349 [00:00<?, ?B/s]
config_sentence_transformers.json: 100%|██████████████████████████████████████████████████████| 116/116 [00:00<?, ?B/s]
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<?, ?B/s]
README.md: 10.7kB [00:00, ?B/s] ?B/s]
Fetching 30 files:   0%|                                                                        | 0/30 [00:04<?, ?it/s]
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镜像网站下载东西了。问题解决!


http://www.kler.cn/a/530780.html

相关文章:

  • STM32_SD卡的SDIO通信_DMA读写
  • 【react-redux】react-redux中的 useDispatch和useSelector的使用与原理解析
  • 影视文件大数据高速分发方案
  • Java手写简单Merkle树
  • Python 中最大堆和最小堆的构建与应用:以寻找第 k 大元素为例
  • 《手札·开源篇》从开源到商业化:中小企业的低成本数字化转型路径 ——以Odoo为数据中台低成本实现售前售中一体化
  • TypeScript (TS) 和 JavaScript (JS)
  • 使用istio实现权重路由
  • DeepSeek发布新模型,遭遇大规模攻击,梁文锋回应证实为假,吴恩达盛赞DeepSeek!AI Weekly 1.27-2.2
  • NetLify账号无法登录解决办法
  • 网络测试-笔记
  • 【C++】线程池实现
  • fpga系列 HDL:XILINX Vivado 常见错误 “在线逻辑分析Debug时ALL_CLOCK没有选项”
  • Rust语言进阶之文件处理:BufReader用法实例(一百零三)
  • React常见状态管理工具详解
  • 【数据结构】(4) 线性表 List
  • 【数据结构-字典树】力扣211. 添加与搜索单词 - 数据结构设计
  • 利用腾讯云cloud studio云端免费部署deepseek-R1
  • 浅析JWT
  • MySQL高效指南:视图、事务、PyMySQL操作与查询优化全解析!
  • ieee模版如何修改参考文献的格式以及多作者省略等
  • 从1号点到n号点最多经过k条边的最短距离
  • Python教学:文档处理及箱线图等
  • 优化 PHP-FPM 参数配置:实现服务器性能提升
  • 手机上运行AI大模型(Deepseek等)
  • 第27节课:安全审计与防御—构建坚固的网络安全防线