MAZALA2024 commited on
Commit
b4bd731
·
verified ·
1 Parent(s): 024bf4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -9
app.py CHANGED
@@ -89,13 +89,22 @@ iface = gr.Interface(
89
  ).queue()
90
 
91
  if __name__ == "__main__":
92
- # Start the RVC service before launching the interface
93
- rvc_service.start()
 
94
 
95
- # Launch the Gradio interface
96
- iface.launch(
97
- debug=True,
98
- show_error=True,
99
- max_threads=10,
100
- share=False
101
- )
 
 
 
 
 
 
 
 
 
89
  ).queue()
90
 
91
  if __name__ == "__main__":
92
+ # Create event loop for the main thread
93
+ loop = asyncio.new_event_loop()
94
+ asyncio.set_event_loop(loop)
95
 
96
+ try:
97
+ # Start RVC service
98
+ rvc_service.start()
99
+
100
+ # Launch Gradio interface
101
+ iface.launch(
102
+ debug=True,
103
+ show_error=True,
104
+ max_threads=10,
105
+ share=False
106
+ )
107
+ finally:
108
+ # Cleanup
109
+ rvc_service.stop()
110
+ loop.close()