Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- name: Install Gradio runtime test dependencies
run: |
python -m pip install --disable-pip-version-check \
--constraint requirements.txt \
pytest==8.3.5 \
"gradio==4.44.1" \
"huggingface_hub<1.0" \
Expand Down
15 changes: 15 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Confirm `ffmpeg -version` also works; install FFmpeg for your platform if absent

### If Installation Or Startup Fails

**The web UI returns HTTP 500 before showing the upload controls:** if the
traceback ends in `gradio_client.utils.get_type` with `argument of type
'bool' is not iterable`, Gradio 4 is failing to read a file component's
schema. This happens before recognition. In the FunClip environment, run
`python -m pip install -r requirements.txt` from this revision, then
`python -m pip check` and relaunch. There is no need to download the ASR
weights again. Other 500 errors need their own traceback.

**`CERTIFICATE_VERIFY_FAILED` during pip install:** fix the HTTPS trust failure first. It means the package download did not complete, so a later `No module named 'funasr'` is not evidence that requirements omitted the package. Check the failing hostname, system clock, proxy and configured package indexes. Use certificates supplied by your OS/Python distribution or an approved corporate CA; never disable certificate verification or make arbitrary hosts trusted to get an install through. Pip supports an approved CA bundle through `--cert`/`PIP_CERT`; see its [certificate documentation](https://pip.pypa.io/en/stable/topics/https-certificates/).

**The package was installed, but this Python cannot find it:** compare the interpreter and pip paths before reinstalling anything:
Expand Down Expand Up @@ -144,6 +152,13 @@ Python 字节码预编译,不跳过依赖或兼容性检查。安装中断后

### 按报错阶段处理

**网页还没显示上传控件就返回 HTTP 500:** 如果异常末尾是
`gradio_client.utils.get_type` 和 `argument of type 'bool' is not iterable`,
是 Gradio 4 无法读取文件组件的字段描述,此时尚未开始识别。在 FunClip
自己的环境中,从此版本的仓库根目录执行 `python -m pip install -r requirements.txt`
和 `python -m pip check`,再重新启动 FunClip。不需要重新下载 ASR 权重;
其他 500 错误请根据各自的异常栈排查。

**安装时出现 `CERTIFICATE_VERIFY_FAILED`:** 先处理 HTTPS 证书信任问题。下载未完成,后续出现 `No module named 'funasr'` 并不说明依赖清单漏了这个包。检查失败域名、系统时间、代理和 pip 源;使用操作系统/Python 发行版提供的证书,企业代理则使用经管理员认可的 CA。不要通过关闭校验或随意信任主机绕过错误。受信任 CA 的 `--cert`/`PIP_CERT` 配置见 [pip 官方证书说明](https://pip.pypa.io/en/stable/topics/https-certificates/)。

**安装成功却找不到模块:** 运行英文部分的解释器和版本检查命令。确认 `sys.executable`、`python -m pip --version` 指向同一个虚拟环境,再用相同的 `python` 启动。不要把另一个 shell、IDE 或 notebook 的安装结果当成当前环境已经装好。
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ moviepy==1.0.3
pillow
numpy==1.26.4
gradio>=4.31.3,<5.0
# Gradio 4's file schema converter cannot read boolean additionalProperties.
pydantic>=2,<2.11
starlette<1.0
modelscope
torch>=1.13
Expand Down
6 changes: 4 additions & 2 deletions tests/test_gradio_runtime_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ def test_gradio4_excludes_breaking_starlette_releases():
assert "starlette<1.0" in requirements


def test_supported_gradio_stack_renders_index():
def test_file_upload_and_download_schema_renders_index():
import gradio
from starlette.testclient import TestClient

with gradio.Blocks() as demo:
gradio.Markdown("FunClip runtime smoke test")
video = gradio.Video()
transcript = gradio.File()
gradio.Button("Recognize").click(lambda _: None, inputs=video, outputs=transcript)

app = gradio.routes.App.create_app(demo)
response = TestClient(app).get("/")
Expand Down