(model_id: str, audio_file_name: str)
| 279 | return result |
| 280 | @task |
| 281 | def automatic_speech_recognition(model_id: str, audio_file_name: str) -> str: |
| 282 | inference = InferenceApi(repo_id=model_id, token=CONFIG["huggingface"]["token"]) |
| 283 | with open(f"{DIRPATH}/{INPUT_PATH}/{audio_file_name}", "rb") as f: |
| 284 | audio = f.read() |
| 285 | text = inference(data=audio, raw_response=True) |
| 286 | result = text.content |
| 287 | return str(result) |
| 288 | @task |
| 289 | def audio_to_audio(model_id: str, audio_file_name: str) -> str: |
| 290 | inference = InferenceApi(repo_id=model_id, token=CONFIG["huggingface"]["token"]) |
nothing calls this directly
no outgoing calls
no test coverage detected