MCPcopy
hub / github.com/modelscope/FunASR / download_if_needed

Function download_if_needed

examples/openai_api/smoke_test.py:25–30  ·  view source on GitHub ↗
(path: Path, sample_url: str, timeout: float)

Source from the content-addressed store, hash-verified

23
24
25def download_if_needed(path: Path, sample_url: str, timeout: float) -> None:
26 if path.exists():
27 return
28 print(f"Downloading sample audio to {path}")
29 with urllib.request.urlopen(sample_url, timeout=timeout) as response:
30 path.write_bytes(response.read())
31
32
33def multipart_body(audio_path: Path, model: str, response_format: str) -> tuple[bytes, str]:

Callers 1

mainFunction · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…