Arafath10 commited on
Commit
68a6d75
·
verified ·
1 Parent(s): f22242d

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -5
main.py CHANGED
@@ -47,12 +47,12 @@ async def generate_audio(
47
  )
48
  print(output_file)
49
  # Return the generated audio file as a response
50
- return FileResponse(output_file, media_type="audio/wav", filename=output_file)
51
 
52
  except Exception as e:
53
  raise HTTPException(status_code=500, detail=f"Error generating audio: {str(e)}")
54
 
55
- finally:
56
- # Clean up the generated file after the response is sent
57
- if os.path.exists(output_file):
58
- os.remove(output_file)
 
47
  )
48
  print(output_file)
49
  # Return the generated audio file as a response
50
+ return FileResponse(output_file, media_type="audio/wav")
51
 
52
  except Exception as e:
53
  raise HTTPException(status_code=500, detail=f"Error generating audio: {str(e)}")
54
 
55
+ # finally:
56
+ # # Clean up the generated file after the response is sent
57
+ # if os.path.exists(output_file):
58
+ # os.remove(output_file)