#2403 Retrying in 8s [Retry 5/5].'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded w

117.181* Posted at: 2 hours ago 👁13

Retrying in 8s [Retry 5/5].
'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /facebook/w2v-bert-2.0/resolve/main/preprocessor_config.json (Caused by ConnectTimeoutError(, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: b9da9c62-a9d8-42ce-8ed6-e1421ec99afb)')' thrown while requesting HEAD https://huggingface.co/facebook/w2v-bert-2.0/resolve/main/preprocessor_config.json
Traceback (most recent call last):
File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/urllib3/connection.py", line 204, in _new_conn

sock = connection.create_connection(

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection

raise err

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/urllib3/util/connection.py", line 73, in create_connection

sock.connect(sa)

TimeoutErr
......
_backoff

response = session.request(method=method, url=url, **kwargs)

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/requests/sessions.py", line 589, in request

resp = self.send(prep, **send_kwargs)

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/requests/sessions.py", line 703, in send

r = adapter.send(request, **kwargs)

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 95, in send

return super().send(request, *args, **kwargs)

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/requests/adapters.py", line 665, in send

raise ConnectTimeout(e, request=request)

requests.exceptions.ConnectTimeout: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /facebook/w2v-bert-2.0/resolve/main/preprocessor_config.json (Caused by ConnectTimeoutError(, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: b9da9c62-a9d8-42ce-8ed6-e1421ec99afb)')

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

Traceback (most recent call last):
File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/transformers/utils/hub.py", line 470, in cached_files

hf_hub_download(

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn

return fn(*args, **kwargs)

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1007, in hf_hub_download

return _hf_hub_download_to_cache_dir(

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1114, in _hf_hub_download_to_cache_dir

_raise_on_head_call_error(head_call_error, force_download, local_files_only)

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1658, in _raise_on_head_call_error

raise LocalEntryNotFoundError(

huggingface_hub.errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.

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

Traceback (most recent call last):
File "/Volumes/Ventoy/video/index-tts/webui.py", line 56, in

tts = IndexTTS2(model_dir=cmd_args.model_dir,

File "/Volumes/Ventoy/video/index-tts/indextts/infer_v2.py", line 115, in init

self.extract_features = SeamlessM4TFeatureExtractor.from_pretrained("facebook/w2v-bert-2.0")

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/transformers/feature_extraction_utils.py", line 384, in from_pretrained

feature_extractor_dict, kwargs = cls.get_feature_extractor_dict(pretrained_model_name_or_path, **kwargs)

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/transformers/feature_extraction_utils.py", line 510, in get_feature_extractor_dict

resolved_feature_extractor_file = cached_file(

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/transformers/utils/hub.py", line 312, in cached_file

file = cached_files(path_or_repo_id=path_or_repo_id, filenames=[filename], **kwargs)

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/transformers/utils/hub.py", line 543, in cached_files

raise OSError(

OSError: We couldn't connect to 'https://huggingface.co' to load the files, and couldn't find them in the cached files.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

7 Replies

您遇到的错误是由于网络连接问题,导致软件无法从 HuggingFace 下载 facebook/w2v-bert-2.0 模型文件。这是使用 Index-TTS2 等依赖 HuggingFace 模型的本地 TTS 功能时的常见问题。

请按以下步骤解决:

  1. 配置网络代理(推荐)

    • 如果您在中国大陆,访问 HuggingFace 需要稳定的网络代理。
    • 在 pyVideoTrans 主界面第5行的“网络代理”处,填入您的代理地址(例如 http://127.0.0.1:10809socks5://127.0.0.1:10808)。
    • 确保代理软件已开启并允许全局流量或对 huggingface.co 的访问。
  2. 手动下载模型文件(备用方案)

    • 如果代理无效,可以尝试手动下载模型。
    • 访问模型页面:https://huggingface.co/facebook/w2v-bert-2.0
    • 下载 preprocessor_config.json 等必需文件。
    • 将下载的文件放置到 HuggingFace 的本地缓存目录中。该目录通常位于:

      • Windows: C:\Users\[您的用户名]\.cache\huggingface\hub\models--facebook--w2v-bert-2.0
      • Mac/Linux: ~/.cache/huggingface/hub/models--facebook--w2v-bert-2.0
    • 您可能需要创建相应的文件夹结构。
  3. 检查防火墙/杀毒软件

    • 暂时禁用防火墙或杀毒软件,确认是否是它们阻止了连接。
  4. 更换 TTS 渠道

    • 如果以上方法均无效,作为临时解决方案,您可以在 pyVideoTrans 的“配音”设置中,暂时选择其他不依赖 HuggingFace 的 TTS 渠道,例如 Edge-TTSVITS-cnenGPT-SoVITS

核心原因:从错误堆栈看,程序在启动 Index-TTS2 时尝试下载 SeamlessM4TFeatureExtractor 所需的配置文件,但因网络超时失败。解决网络连接问题是关键。

请查看更多参考文档:

Traceback (most recent call last):
File "/Volumes/Ventoy/video/index-tts/webui.py", line 557, in

demo.launch(server_name=cmd_args.host, server_port=cmd_args.port)

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/gradio/blocks.py", line 2761, in launch

raise Exception(

Exception: Couldn't start the app because 'http://localhost:7860/gradio_api/startup-events' failed (code 503). Check your network or proxy settings to ensure localhost is accessible.

您遇到的错误表明 Index-TTS2 的 WebUI 启动失败,因为无法连接到本地服务端口 localhost:7860。这通常是因为端口已被占用或网络代理设置冲突。请按以下步骤解决:

  1. 检查端口占用

    • 打开终端(Mac)或命令提示符(Windows)。
    • 运行命令查看 7860 端口是否被占用:

      • Mac/Linux: lsof -i :7860
      • Windows: netstat -ano | findstr :7860
    • 如果发现占用进程,请终止它(在 Windows 上使用 taskkill /PID [进程ID] /F,在 Mac/Linux 上使用 kill [进程ID])。
  2. 修改启动端口

    • 在启动 Index-TTS2 的 WebUI 时,通过命令行参数指定一个不同的端口。例如,将端口改为 7861:

      python webui.py --port 7861
    • 如果您使用的是整合包或一键启动脚本,请修改脚本中的 --port 参数。
  3. 检查网络代理设置

    • 如果您正在使用网络代理(VPN 或代理软件),请暂时关闭代理,然后重试启动 Index-TTS2。
    • 某些代理软件会劫持 localhost 流量,导致本地服务无法正常通信。
  4. 检查防火墙

    • 暂时禁用系统防火墙,确认是否是防火墙阻止了本地回环地址(127.0.0.1/localhost)的通信。
  5. 确保 Index-TTS2 依赖已正确安装

    • 在您的 Index-TTS2 项目目录下,确保已安装所有依赖。可以尝试重新安装:

      pip install -r requirements.txt

核心原因:Gradio 框架在启动时尝试通过本地 HTTP 端口(默认 7860)建立内部通信,但该端口被占用或网络配置(尤其是代理)阻止了 localhost 的访问。

如果以上步骤无效:请提供您启动 Index-TTS2 的具体命令或方式,以便进一步分析。

'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /facebook/w2v-bert-2.0/resolve/main/preprocessor_config.json (Caused by ConnectTimeoutError(, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 7717f1e7-7e9e-496d-bfe7-7f7569cb4efa)')' thrown while requesting HEAD https://huggingface.co/facebook/w2v-bert-2.0/resolve/main/preprocessor_config.json

您遇到的仍然是网络连接问题,导致无法从 HuggingFace 下载模型文件。这是使用依赖 HuggingFace 模型的本地功能(如 Index-TTS2、FunASR 等)时的常见问题。请按以下步骤解决:配置网络代理(最有效):在 pyVideoTrans 主界面第5行的“网络代理”处,填入您的代理地址。格式通常为 http://127.0.0.1:[端口] 或 socks5://127.0.0.1:[端口]。请确保您的代理软件已开启,并且允许对 huggingface.co 域名的访问。如果您使用的是系统全局代理,也请确保其正常工作。设置环境变量(针对命令行/源码运行):如果您是通过命令行或源码运行相关功能(如 Index-TTS2 的 WebUI),可以设置 HTTP/HTTPS 代理环境变量。在终端中执行(根据您的代理类型和端口修改):export HTTP_PROXY="http://127.0.0.1:10809"export HTTPS_PROXY="http://127.0.0.1:10809"然后,在同一个终端窗口中启动您的程序。手动下载模型文件(备用方案):访问模型页面:https://huggingface.co/facebook/w2v-bert-2.0。点击“Files and versions”标签页。下载 preprocessor_config.json 文件。将下载的文件放置到 HuggingFace 的本地缓存目录中。该目录通常位于:Windows: C:\Users[您的用户名].cache\huggingface\hub\models--facebook--w2v-bert-2.0Mac/Linux: ~/.cache/huggingface/hub/models--facebook--w2v-bert-2.0您可能需要手动创建 models--facebook--w2v-bert-2.0 文件夹,并将文件放入其中。使用离线模式(高级):参考 HuggingFace 官方文档配置离线模式:https://huggingface.co/docs/transformers/installation#offline-mode。这需要预先下载所有依赖模型。检查防火墙/杀毒软件:暂时禁用防火墙或杀毒软件,确认是否是它们阻止了连接。核心原因:该错误明确显示连接 huggingface.co 超时。根本原因是您的网络无法直接访问 HuggingFace 服务器(在中国大陆很常见)。解决网络问题是关键。如果以上方法均无效:请确认您的代理地址和端口是否正确,代理软件是否运行正常。您可以尝试在浏览器中访问 https://huggingface.co/facebook/w2v-bert-2.0,看是否能正常打开。如果浏览器也无法访问,说明您的代理配置有问题。请查看更多参考文档:常见网络连接错误Index-TTS2 整合包win版

端口没有被占用,却提升

Traceback (most recent call last):
File "/Volumes/Ventoy/video/index-tts/webui.py", line 557, in

demo.launch(server_name=cmd_args.host, server_port=cmd_args.port)

File "/Volumes/Ventoy/opt/miniconda3/envs/indextts/lib/python3.10/site-packages/gradio/blocks.py", line 2761, in launch

raise Exception(

Exception: Couldn't start the app because 'http://localhost:7860/gradio_api/startup-events' failed (code 503). Check your network or proxy settings to ensure localhost is accessible.

端口未被占用但启动失败,错误指向 localhost 网络访问问题,这通常是由系统代理设置冲突Gradio内部依赖的网络库问题导致的。请按以下步骤排查:

1. 检查并清除系统代理设置

这是最常见的原因。即使您没有主动设置,某些软件(如VPN、加速器、科学上网工具)可能会修改系统代理,导致 localhost 流量被错误地转发到外部代理服务器而失败。

  • 在终端中检查当前代理环境变量

    echo $HTTP_PROXY
    echo $HTTPS_PROXY
    echo $http_proxy
    echo $https_proxy
  • 如果上述命令输出了代理地址,请清除它们(仅限当前终端会话):

    unset HTTP_PROXY HTTPS_PROXY http_proxy https_proxy
  • 清除后,在同一个终端中重新启动 Index-TTS2

2. 修改启动命令,绑定到 0.0.0.0 并指定端口

有时指定明确的服务器地址可以绕过一些本地路由问题。

  • 在启动 webui.py 时,使用以下参数:

    python webui.py --server-name 0.0.0.0 --server-port 7860

    或者尝试另一个端口(如 7861):

    python webui.py --server-name 0.0.0.0 --server-port 7861

3. 检查 hosts 文件

极少数情况下,hosts 文件被修改,将 localhost 指向了错误的IP地址。

  • Mac/Linux:检查 /etc/hosts 文件,确保包含一行 127.0.0.1 localhost
  • Windows:检查 C:\Windows\System32\drivers\etc\hosts 文件,确保包含一行 127.0.0.1 localhost

4. 以管理员/root权限运行(仅限Windows/Mac权限问题)

在某些系统上,创建网络套接字可能需要更高权限。尝试以管理员身份(Windows)或使用 sudo(Mac/Linux,需谨慎)运行启动命令。

5. 检查 Gradio 版本兼容性

Gradio 版本过新或过旧可能与您的环境不兼容。

  • 在您的 Index-TTS2 环境中,尝试安装一个较稳定的 Gradio 版本:

    pip install gradio==3.50.2

6. 核心原因与总结

错误码 503 表示服务不可用。Gradio 在启动时尝试通过内部 HTTP 请求(/gradio_api/startup-events)进行初始化,但该请求失败。最可能的原因是系统环境变量中的代理设置干扰了 localhost 的环回通信

请优先执行第1步(清除代理变量)和第2步(修改启动参数)。如果问题依旧,请提供您完整的启动命令和终端输出。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions