MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / load_audio

Function load_audio

tensorrt_llm/inputs/utils.py:323–334  ·  view source on GitHub ↗
(
    audio: str,
    format: str = "pt",
    device: str = "cuda",
)

Source from the content-addressed store, hash-verified

321
322
323def load_audio(
324 audio: str,
325 format: str = "pt",
326 device: str = "cuda",
327) -> Tuple[np.ndarray, int]:
328 parsed_url = urlparse(audio)
329 if parsed_url.scheme in ["http", "https"]:
330 audio = requests.get(audio, stream=True, timeout=10)
331 audio = BytesIO(audio.content)
332
333 audio = soundfile.read(audio)
334 return audio
335
336
337async def async_load_audio(

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected