Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,12 @@ def query(api_url, payload=None, data=None):
|
|
17 |
response = requests.post(api_url, headers=headers, data=data)
|
18 |
else:
|
19 |
response = requests.post(api_url, headers=headers, json=payload)
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
# Define the function to translate speech
|
23 |
def translate_speech(audio_file):
|
|
|
17 |
response = requests.post(api_url, headers=headers, data=data)
|
18 |
else:
|
19 |
response = requests.post(api_url, headers=headers, json=payload)
|
20 |
+
response_json = response.json()
|
21 |
+
if 'error' in response_json:
|
22 |
+
print(f"Error in query function: {response_json['error']}")
|
23 |
+
return None
|
24 |
+
return response_json
|
25 |
+
|
26 |
|
27 |
# Define the function to translate speech
|
28 |
def translate_speech(audio_file):
|