Huanshere / Huanshere/VideoLingo

在国内使用时whisperx.load_model会卡6 7分钟

Open
#449 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
18.5k
Forks
2k
Avg merge
7h 41m
Merged PRs (30d)
12

Description

你好!在测试时发现在调用whisperx.load_model会卡大概6 7分钟。

通过添加huggingface模块日志发现huggingface指向了huggingface.co,而我访问huggingface.co会很卡,我看在代码中通过os.environ['HF_ENDPOINT'] = check_hf_mirror()设置了HF_ENDPOINT环境变量为hf-mirror.com,但是却没有生效,后面发现是因为在import whisperx的时候,huggingface就会缓存当前的环境变量HF_ENDPOINT,而此时还未执行os.environ['HF_ENDPOINT'] = check_hf_mirror(),所以在whispxer以及huggingface模块中,HF_ENDPOINT还是默认的huggingface.co。

我将import whisperx放在os.environ['HF_ENDPOINT'] = check_hf_mirror()后面测试,发现该问题未出现。

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the import path for whisperx and the call to whisperx.load_model, then inspect where check_hf_mirror() assigns HF_ENDPOINT relative to the whisperx and Hugging Face imports. Reproduce the delayed load in a domestic network environment and verify that model loading uses the configured mirror before imports cache the endpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.