MCPcopy Create free account
hub / github.com/modelscope/modelscope / generate_sd_scp_from_url

Function generate_sd_scp_from_url

modelscope/utils/audio/audio_utils.py:304–322  ·  view source on GitHub ↗

generate audio_scp files from url input for speaker diarization.

(urls: Union[tuple, list])

Source from the content-addressed store, hash-verified

302
303
304def generate_sd_scp_from_url(urls: Union[tuple, list]):
305 """
306 generate audio_scp files from url input for speaker diarization.
307 """
308 audio_scps = []
309 for url in urls:
310 if os.path.exists(url) and (
311 url.lower().endswith(SUPPORT_AUDIO_TYPE_SETS)):
312 audio_scp = url
313 else:
314 result = urlparse(url)
315 if result.scheme is not None and len(result.scheme) > 0:
316 storage = HTTPStorage()
317 wav_bytes = storage.read(url)
318 audio_scp = wav_bytes
319 else:
320 raise ValueError("Can't download from {}.".format(url))
321 audio_scps.append(audio_scp)
322 return audio_scps
323
324
325def update_local_model(model_config, model_path, extra_args):

Callers

nothing calls this directly

Calls 4

readMethod · 0.95
HTTPStorageClass · 0.90
existsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…