Skip to content

Commit 8dfbbfe

Browse files
WEIFENG2333claudehappy-otter
committed
Fix integration CI: use HuggingFace hub, increase timeout
- Auto-detect CI environment and use HuggingFace instead of ModelScope (GitHub Actions has better connectivity to HuggingFace) - Increase load_model RPC timeout from 300s to 600s - Locally still defaults to ModelScope for China users Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
1 parent a88fc77 commit 8dfbbfe

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/funasr_server/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def load_model(
223223
params["spk_model"] = spk_model
224224
if device:
225225
params["device"] = device
226-
return self._rpc_call("load_model", params, timeout=300)
226+
return self._rpc_call("load_model", params, timeout=600)
227227

228228
def unload_model(self, name: str = "default") -> dict:
229229
"""Unload a model and free memory."""

tests/test_integration.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"""
1616

1717
import math
18+
import os
1819
import struct
1920
import tempfile
2021
import wave
@@ -24,6 +25,9 @@
2425

2526
from funasr_server import FunASR
2627

28+
# Use HuggingFace in CI (GitHub Actions), ModelScope locally (China)
29+
_HUB = "hf" if os.environ.get("CI") else "ms"
30+
2731

2832
# Mark all tests in this module as integration tests
2933
pytestmark = pytest.mark.integration
@@ -110,6 +114,7 @@ def test_load_vad_model(self, client):
110114
result = client.load_model(
111115
model="iic/speech_fsmn_vad_zh-cn-16k-common-pytorch",
112116
name="vad",
117+
hub=_HUB,
113118
)
114119
assert result["status"] == "loaded"
115120
assert result["name"] == "vad"
@@ -169,6 +174,7 @@ def test_load_asr_model(self, client):
169174
result = client.load_model(
170175
model="iic/SenseVoiceSmall",
171176
name="asr",
177+
hub=_HUB,
172178
)
173179
assert result["status"] == "loaded"
174180
assert result["name"] == "asr"

0 commit comments

Comments
 (0)