R
Runpod5mo ago
nqcuong

In Faster Whisper Serverless, how to get transcribe result?

In python code, I sent request :
# S3 bucket and key for the audio file
s3 = boto3.client('s3')
# RunPog API configuration

presigned_url = s3.generate_presigned_url(
'get_object',
Params={'Bucket': BUCKET_NAME, 'Key': av_path},
ExpiresIn=3600 # valid for 1 hour
)

print(presigned_url)

payload = {
"input": {
"audio_base64": presigned_url,
"model": "large-v3",
"language": "en",
"beam_size": 5,
"vad_filter": True
}
}

headers = {
"Authorization": f"Bearer {RUNPOD_API_KEY}",
"Content-Type": "application/json"
}

start_time = time.time()
response = requests.post(
f"https://api.runpod.ai/v2/{ENDPOINT_ID}/run",
json=payload,
headers=headers
)
job = response.json()
print(f"Response data: {job}")
job_id = job.get("id")
print(f"Submitted job: {job_id}")

# Step 2: Poll until complete
status_url = f"https://api.runpod.ai/v2/{ENDPOINT_ID}/status/{job_id}"
while True:
time.sleep(3)
status_response = requests.get(status_url, headers=headers)
status = status_response.json()
if status["status"] == "COMPLETED":
break
elif status["status"] == "FAILED":
raise Exception("Transcription job failed.")
else:
print(f"Job status: {status}")
# print(f"Job status: {status['status']}")
# S3 bucket and key for the audio file
s3 = boto3.client('s3')
# RunPog API configuration

presigned_url = s3.generate_presigned_url(
'get_object',
Params={'Bucket': BUCKET_NAME, 'Key': av_path},
ExpiresIn=3600 # valid for 1 hour
)

print(presigned_url)

payload = {
"input": {
"audio_base64": presigned_url,
"model": "large-v3",
"language": "en",
"beam_size": 5,
"vad_filter": True
}
}

headers = {
"Authorization": f"Bearer {RUNPOD_API_KEY}",
"Content-Type": "application/json"
}

start_time = time.time()
response = requests.post(
f"https://api.runpod.ai/v2/{ENDPOINT_ID}/run",
json=payload,
headers=headers
)
job = response.json()
print(f"Response data: {job}")
job_id = job.get("id")
print(f"Submitted job: {job_id}")

# Step 2: Poll until complete
status_url = f"https://api.runpod.ai/v2/{ENDPOINT_ID}/status/{job_id}"
while True:
time.sleep(3)
status_response = requests.get(status_url, headers=headers)
status = status_response.json()
if status["status"] == "COMPLETED":
break
elif status["status"] == "FAILED":
raise Exception("Transcription job failed.")
else:
print(f"Job status: {status}")
# print(f"Job status: {status['status']}")
I am always get status data:
Status: {'delayTime': 1164, 'executionTime': 40, 'id': '2db7b7e9-707d-4e52-86c7-4313c968dec5-e1', 'status': 'COMPLETED', 'workerId': 'r1de9b8p7btmh1'}
Status: {'delayTime': 1164, 'executionTime': 40, 'id': '2db7b7e9-707d-4e52-86c7-4313c968dec5-e1', 'status': 'COMPLETED', 'workerId': 'r1de9b8p7btmh1'}
There is no transcript data. How to get it? I don't see any document. Please help!
6 Replies
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
nqcuong
nqcuongOP5mo ago
I have updated the 'payload' data structure as your comments but problem does not resolve. When I check the Logs in runpod console. I see error:
[error]Failed to return job results. | 400, message='Bad Request', url=URL('https://api.runpod.ai/v2/xxxxxxxxxxxxxxxx/job-done/tv0vh9lisnxwjd/9fb5bf97-1f19-4d4b-a759-fc2ca2dac1a7-e1?gpu=NVIDIA+L4&isStream=false')
[error]Failed to return job results. | 400, message='Bad Request', url=URL('https://api.runpod.ai/v2/xxxxxxxxxxxxxxxx/job-done/tv0vh9lisnxwjd/9fb5bf97-1f19-4d4b-a759-fc2ca2dac1a7-e1?gpu=NVIDIA+L4&isStream=false')
This error is the same as my previous test.
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
nqcuong
nqcuongOP5mo ago
Please see full logs for this job:
tv0vh9lisnxwjd[info]Finished.
tv0vh9lisnxwjd[error]Failed to return job results. | 400, message='Bad Request', url=URL('https://api.runpod.ai/v2/xxxxxxxxxxxxxxx/job-done/tv0vh9lisnxwjd/9fb5bf97-1f19-4d4b-a759-fc2ca2dac1a7-e1?gpu=NVIDIA+L4&isStream=false')
tv0vh9lisnxwjd[info]Started.
tv0vh9lisnxwjd[info]--- Starting Serverless Worker | Version 1.5.2 ---\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license\n
tv0vh9lisnxwjd[info]By pulling and using the container, you accept the terms and conditions of this license:\n
tv0vh9lisnxwjd[info]This container image and its contents are governed by the NVIDIA Deep Learning Container License.\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]CUDA Version 11.7.1\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]==========\n
tv0vh9lisnxwjd[info]== CUDA ==\n
tv0vh9lisnxwjd[info]==========\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]Finished.
tv0vh9lisnxwjd[error]Failed to return job results. | 400, message='Bad Request', url=URL('https://api.runpod.ai/v2/xxxxxxxxxxxxxxx/job-done/tv0vh9lisnxwjd/9fb5bf97-1f19-4d4b-a759-fc2ca2dac1a7-e1?gpu=NVIDIA+L4&isStream=false')
tv0vh9lisnxwjd[info]Started.
tv0vh9lisnxwjd[info]--- Starting Serverless Worker | Version 1.5.2 ---\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license\n
tv0vh9lisnxwjd[info]By pulling and using the container, you accept the terms and conditions of this license:\n
tv0vh9lisnxwjd[info]This container image and its contents are governed by the NVIDIA Deep Learning Container License.\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]CUDA Version 11.7.1\n
tv0vh9lisnxwjd[info]\n
tv0vh9lisnxwjd[info]==========\n
tv0vh9lisnxwjd[info]== CUDA ==\n
tv0vh9lisnxwjd[info]==========\n
tv0vh9lisnxwjd[info]\n
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
nqcuong
nqcuongOP5mo ago
Yes, you are right. It works when I change to 'enable_vad'. Thank you so much!

Did you find this page helpful?