Spaces:
Runtime error
Runtime error
ParthCodes
commited on
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|