Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,8 +55,10 @@ def generate_audio():
|
|
| 55 |
output_path = os.path.join(OUTPUT_PATH, output_filename)
|
| 56 |
sf.write(output_path, output_audio, pipe.vae.sampling_rate)
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
|
|
|
|
|
|
| 60 |
|
| 61 |
# Return the WAV file
|
| 62 |
#return jsonify({"file_path": absolute_output_path}), 200
|
|
|
|
| 55 |
output_path = os.path.join(OUTPUT_PATH, output_filename)
|
| 56 |
sf.write(output_path, output_audio, pipe.vae.sampling_rate)
|
| 57 |
|
| 58 |
+
if os.path.exists(output_path):
|
| 59 |
+
return send_file(output_path, as_attachment=True)
|
| 60 |
+
else:
|
| 61 |
+
return {"error": f"File not found at {output_path}"}, 404
|
| 62 |
|
| 63 |
# Return the WAV file
|
| 64 |
#return jsonify({"file_path": absolute_output_path}), 200
|