Can we use serverless faster Whisper for local audio?
I deployed faster Whisper using serverless and invoked it using
"import requests
url = "https://api.runpod.ai/v2/faster-whisper/runsync"
payload = {
"input": {
"audio": "https://github.com/runpod-workers/sample-inputs/raw/main/audio/gettysburg.wav",
"model": "base",
"transcription": "plain_text",
"translate": False,
"language": "en",
"temperature": 0,
"best_of": 5,
"beam_size": 5,
"patience": 1,
"suppress_tokens": "-1",
"condition_on_previous_text": False,
"temperature_increment_on_fallback": 0.2,
"compression_ratio_threshold": 2.4,
"logprob_threshold": -1,
"no_speech_threshold": 0.6,
"word_timestamps": False
},
"enable_vad": False
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "API-KEY"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)" it's working fine, But when I'm using the local audio from my system i'm getting this error ""delayTime":995,"error":"{"error_type": "<class 'av.error.FileNotFoundError'>", "error_message": "[Errno 2] No such file or directory: 'None'","
6 Replies
nope as worker is remote machine and it does not have access to your local files
I think you can use base64, here is a example:
audio_file = "audio2.wav"
audio_base64 = base64.b64encode(open(audio_file, "rb").read()).decode("utf-8")
payload = {
"input": {
"audio_base64": audio_base64,
"model": "tiny",
"transcription": "plain_text",
"translate": False,
"language": "en",
"temperature": 0,
"best_of": 1,
"beam_size": 1,
"patience": 1,
"suppress_tokens": "-1",
"condition_on_previous_text": False,
"temperature_increment_on_fallback": 0.2,
"compression_ratio_threshold": 2.4,
"logprob_threshold": -1,
"no_speech_threshold": 0.6,
"word_timestamps": False
},
"enable_vad": False
}
Getting this error
ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
That means the host is invalid?
The audio_base64 returns that error but same code works when a URL is provided for the audio. The context is trying to run whisper on a local audio file.