Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,7 +61,7 @@ def process_audio_file(file_data, url):
|
|
| 61 |
if inferred_class == "Silence" and len(top_two_indices) > 1:
|
| 62 |
inferred_class = class_names[top_two_indices[1]]
|
| 63 |
|
| 64 |
-
answer_dict = {'
|
| 65 |
return answer_dict
|
| 66 |
except Exception as e:
|
| 67 |
logging.error(f"Error processing {url}: {e}")
|
|
@@ -113,7 +113,7 @@ def process_audio(params):
|
|
| 113 |
solutions.append(result)
|
| 114 |
|
| 115 |
result_url = f"{api}/{job_id}"
|
| 116 |
-
|
| 117 |
|
| 118 |
return json.dumps({"solutions": solutions}, indent=4)
|
| 119 |
|
|
|
|
| 61 |
if inferred_class == "Silence" and len(top_two_indices) > 1:
|
| 62 |
inferred_class = class_names[top_two_indices[1]]
|
| 63 |
|
| 64 |
+
answer_dict = {'audio_url': url, 'answer': [inferred_class]}
|
| 65 |
return answer_dict
|
| 66 |
except Exception as e:
|
| 67 |
logging.error(f"Error processing {url}: {e}")
|
|
|
|
| 113 |
solutions.append(result)
|
| 114 |
|
| 115 |
result_url = f"{api}/{job_id}"
|
| 116 |
+
send_results_to_api(solutions, result_url)
|
| 117 |
|
| 118 |
return json.dumps({"solutions": solutions}, indent=4)
|
| 119 |
|