MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / audio_classification

Function audio_classification

bmtools/tools/hugging_tools/api.py:308–314  ·  view source on GitHub ↗
(model_id: str, audio_file_name: str)

Source from the content-addressed store, hash-verified

306 return result
307 @task
308 def audio_classification(model_id: str, audio_file_name: str) -> str:
309 inference = InferenceApi(repo_id=model_id, token=CONFIG["huggingface"]["token"])
310 with open(f"{DIRPATH}/{INPUT_PATH}/{audio_file_name}", "rb") as f:
311 audio = f.read()
312 response = inference(data=audio, raw_response=True)
313 result = response.json()
314 return str(result)
315
316 @tool.get("/model_docs")
317 @format_docs(str(task_list))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected