pengdaqian commited on
Commit
4cfe760
·
1 Parent(s): a921492
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import os
 
2
  import threading
3
 
4
  os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
@@ -239,7 +240,8 @@ def auto_search(name):
239
  if not os.path.exists(save_music_path):
240
  os.makedirs(save_music_path)
241
 
242
- config = {'logfilepath': 'musicdl.log', save_music_path: save_music_path, 'search_size_per_source': 5, 'proxies': {}}
 
243
  save_path = os.path.join(save_music_path, name + '.mp3')
244
  # youtube
245
  get_youtube(name, os.path.join(save_music_path, name))
@@ -265,6 +267,12 @@ def auto_search(name):
265
 
266
 
267
  app = gr.Blocks()
 
 
 
 
 
 
268
  with app:
269
  title = "Singer Voice Clone 0.1 Demo"
270
  desc = """ small singer voice clone Demo App. <br />
@@ -339,4 +347,6 @@ with app:
339
  vc_search.click(auto_search, [vc_input2], [vc_output1, vc_input3])
340
  vc_submit.click(svc_main, [sid, vc_input3], [vc_output1, vc_output2])
341
 
342
- app.queue(max_size=3, api_open=False).launch(share=True)
 
 
 
1
  import os
2
+ import sys
3
  import threading
4
 
5
  os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
 
240
  if not os.path.exists(save_music_path):
241
  os.makedirs(save_music_path)
242
 
243
+ config = {'logfilepath': 'musicdl.log', save_music_path: save_music_path, 'search_size_per_source': 5,
244
+ 'proxies': {}}
245
  save_path = os.path.join(save_music_path, name + '.mp3')
246
  # youtube
247
  get_youtube(name, os.path.join(save_music_path, name))
 
267
 
268
 
269
  app = gr.Blocks()
270
+
271
+
272
+ def on_close():
273
+ sys.exit(0)
274
+
275
+
276
  with app:
277
  title = "Singer Voice Clone 0.1 Demo"
278
  desc = """ small singer voice clone Demo App. <br />
 
347
  vc_search.click(auto_search, [vc_input2], [vc_output1, vc_input3])
348
  vc_submit.click(svc_main, [sid, vc_input3], [vc_output1, vc_output2])
349
 
350
+ app.set_on_close(on_close)
351
+
352
+ app.queue(max_size=3, api_open=False).launch()