R
RunPod10mo ago
yiuhoward

Connection aborted for Faster-Whisper endpoint when using "large-v2" model (Pyhton & NodeJS)

I tried to hit the Faster-Whisper endpoint using large-v2 model. I got ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) when using Python and ConnectionClosed: The socket connection was closed unexpectedly. For more information, pass verbose: true in the second argument to fetch() when using NodeJS. With Python, I managed to get proper response from the endpoint when using the medium model. I've also tried using "large-v1" but got the connection aborted error too. With NodeJS, I got the same error with the medium, large-v1, and large-v2 model. Audio URL: https://dts.podtrac.com/redirect.mp3/api.spreaker.com/download/episode/58610513/ca7f9009_d40c_6b5a_05bb_fb5ee92fdfef.mp3 Python Code used:
def transcribe(file_path, audio, language="fr", initial_prompt=None):
url = "https://api.runpod.ai/v2/faster-whisper/runsync"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": os.environ['RUNPOD_API_KEY'],
}
data = {
"input": {
"audio": audio,
"model": "large-v2",
"transcription": "plain_text",
"translate": False,
"language": language,
"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,
"initial_prompt": initial_prompt,
},
"enable_vad": False,
}
try:
response = requests.post(url, json=data, headers=headers)
response.raise_for_status()
data = response.json()
except requests.exceptions.RequestException as error:
print(f"Error: {error}")
def transcribe(file_path, audio, language="fr", initial_prompt=None):
url = "https://api.runpod.ai/v2/faster-whisper/runsync"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": os.environ['RUNPOD_API_KEY'],
}
data = {
"input": {
"audio": audio,
"model": "large-v2",
"transcription": "plain_text",
"translate": False,
"language": language,
"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,
"initial_prompt": initial_prompt,
},
"enable_vad": False,
}
try:
response = requests.post(url, json=data, headers=headers)
response.raise_for_status()
data = response.json()
except requests.exceptions.RequestException as error:
print(f"Error: {error}")
2 Replies
Madiator2011
Madiator201110mo ago
runsyc have timeout For longer jobs you might want to use /run
yiuhoward
yiuhowardOP10mo ago
Thank you so much @Papa Madiator , it works now.
Want results from more Discord servers?
Add your server