pvanand commited on
Commit
8582da0
1 Parent(s): 59ec87d

Update speech_api.py

Browse files
Files changed (1) hide show
  1. speech_api.py +1 -1
speech_api.py CHANGED
@@ -62,7 +62,7 @@ async def speech_to_text(file: UploadFile = File(...), source_language: str = "e
62
  asr_result = client.asr(audio_content, source_language=source_language)
63
 
64
  # Extract the transcribed text from the complex JSON structure
65
- transcribed_text = asr_result['transcription']['pipelineResponse'][0]['output'][0]['source']
66
 
67
  return {"text": transcribed_text}
68
  except KeyError:
 
62
  asr_result = client.asr(audio_content, source_language=source_language)
63
 
64
  # Extract the transcribed text from the complex JSON structure
65
+ transcribed_text = asr_result['pipelineResponse'][0]['output'][0]['source']
66
 
67
  return {"text": transcribed_text}
68
  except KeyError: