AmpParth commited on
Commit
c5f41aa
·
verified ·
1 Parent(s): 333fa1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -198,11 +198,7 @@ def transcription(file):
198
  payload = {"buffer": buffer_data}
199
  options = PrerecordedOptions(model="nova-2", smart_format=True, diarize=True, redact='ssn')
200
  response = deepgram.listen.prerecorded.v("1").transcribe_file(payload, options)
201
- if response['status'] == "ok":
202
- paragraphs = [paragraph['transcript'] for paragraph in response['results']['channels'][0]['alternatives'][0]['paragraphs']]
203
- return " ".join(paragraphs)
204
- else:
205
- raise Exception("Transcription failed")
206
  except Exception as e:
207
  print(f"Exception: {e}")
208
  return None
 
198
  payload = {"buffer": buffer_data}
199
  options = PrerecordedOptions(model="nova-2", smart_format=True, diarize=True, redact='ssn')
200
  response = deepgram.listen.prerecorded.v("1").transcribe_file(payload, options)
201
+ return response['results']['channels'][0]['alternatives'][0]['paragraphs'][0]['transcript']
 
 
 
 
202
  except Exception as e:
203
  print(f"Exception: {e}")
204
  return None