ParthCodes commited on
Commit
92c5f51
·
verified ·
1 Parent(s): 6620799

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -193,7 +193,16 @@ def video_to_audio(input_video):
193
  audio_bytesio = BytesIO(audio_binary)
194
  audio_bytesio2 = BytesIO(audio_binary)
195
 
196
- response = requests.post(AUDIO_API_URL, headers=headers, data=audio_bytesio)
 
 
 
 
 
 
 
 
 
197
  formatted_response = {}
198
  for ele in response.json():
199
  score, label = ele.values()
 
193
  audio_bytesio = BytesIO(audio_binary)
194
  audio_bytesio2 = BytesIO(audio_binary)
195
 
196
+ flag = False
197
+ while flag == False:
198
+ response = requests.post(AUDIO_API_URL, headers=headers, data=audio_bytesio)
199
+ if type(response.json()) == type({}):
200
+ print(response.json())
201
+ time.sleep(30)
202
+ print("Retrying for Speech Emotions")
203
+ else:
204
+ flag = True
205
+
206
  formatted_response = {}
207
  for ele in response.json():
208
  score, label = ele.values()