Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,21 +93,21 @@ def get_audio_data(url):
|
|
| 93 |
response.raise_for_status()
|
| 94 |
return response.content
|
| 95 |
|
| 96 |
-
def send_results_to_api(data, result_url):
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
|
| 112 |
def process_audio(params):
|
| 113 |
try:
|
|
|
|
| 93 |
response.raise_for_status()
|
| 94 |
return response.content
|
| 95 |
|
| 96 |
+
# def send_results_to_api(data, result_url):
|
| 97 |
+
# headers = {"Content-Type": "application/json"}
|
| 98 |
+
# try:
|
| 99 |
+
# response = requests.post(result_url, json=data, headers=headers)
|
| 100 |
+
# response.raise_for_status() # Raise error for non-200 responses
|
| 101 |
+
# return response.json() # Return any JSON response from the API
|
| 102 |
+
# except requests.exceptions.HTTPError as http_err:
|
| 103 |
+
# logging.error(f"HTTP error occurred: {http_err}")
|
| 104 |
+
# return {"error": f"HTTP error occurred: {http_err}"}
|
| 105 |
+
# except requests.exceptions.RequestException as req_err:
|
| 106 |
+
# logging.error(f"Request error occurred: {req_err}")
|
| 107 |
+
# return {"error": f"Request error occurred: {req_err}"}
|
| 108 |
+
# except ValueError as val_err:
|
| 109 |
+
# logging.error(f"Error decoding JSON response: {val_err}")
|
| 110 |
+
# return {"error": f"Error decoding JSON response: {val_err}"}
|
| 111 |
|
| 112 |
def process_audio(params):
|
| 113 |
try:
|