Hev832 commited on
Commit
0938a64
·
verified ·
1 Parent(s): 3925892

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -3
app.py CHANGED
@@ -21,7 +21,7 @@ import shutil
21
  import urllib.request
22
  import gdown
23
  import subprocess
24
-
25
  main_dir = Path().resolve()
26
  print(main_dir)
27
 
@@ -198,8 +198,20 @@ def download_online_model(url, dir_name):
198
 
199
 
200
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  # Gradio Blocks Interface with Tabs
202
- with gr.Blocks(title="Hex RVC") as app:
203
  gr.Markdown("# Hex RVC")
204
 
205
  with gr.Tab("Inference"):
@@ -303,4 +315,8 @@ with gr.Blocks(title="Hex RVC") as app:
303
 
304
 
305
  # Launch the Gradio app
306
- app.launch(share=True, debug=True)
 
 
 
 
 
21
  import urllib.request
22
  import gdown
23
  import subprocess
24
+ from argparse import ArgumentParser
25
  main_dir = Path().resolve()
26
  print(main_dir)
27
 
 
198
 
199
 
200
 
201
+
202
+ if __name__ == '__main__':
203
+ parser = ArgumentParser(description='Generate a AI song in the song_output/id directory.', add_help=True)
204
+ parser.add_argument("--share", action="store_true", dest="share_enabled", default=False, help="Enable sharing")
205
+ parser.add_argument("--listen", action="store_true", default=False, help="Make the UI reachable from your local network.")
206
+ parser.add_argument('--listen-host', type=str, help='The hostname that the server will use.')
207
+ parser.add_argument('--listen-port', type=int, help='The listening port that the server will use.')
208
+ args = parser.parse_args()
209
+
210
+
211
+
212
+
213
  # Gradio Blocks Interface with Tabs
214
+ with gr.Blocks(title="Hex RVC", theme="gradio/soft") as app:
215
  gr.Markdown("# Hex RVC")
216
 
217
  with gr.Tab("Inference"):
 
315
 
316
 
317
  # Launch the Gradio app
318
+ app.launch(
319
+ share=args.share_enabled,
320
+ server_name=None if not args.listen else (args.listen_host or '0.0.0.0'),
321
+ server_port=args.listen_port,
322
+ )