Yushen CHEN commited on
Commit
a931cba
·
2 Parent(s): b53efc4 77d011b

Merge pull request #797 from YoungPhlo/feat/browser-autolaunch

Browse files
Files changed (2) hide show
  1. README.md +3 -0
  2. src/f5_tts/infer/infer_gradio.py +11 -2
README.md CHANGED
@@ -120,6 +120,9 @@ f5-tts_infer-gradio --port 7860 --host 0.0.0.0
120
 
121
  # Launch a share link
122
  f5-tts_infer-gradio --share
 
 
 
123
  ```
124
 
125
  <details>
 
120
 
121
  # Launch a share link
122
  f5-tts_infer-gradio --share
123
+
124
+ # Automatically open in default web browser
125
+ f5-tts_infer-gradio --autolaunch
126
  ```
127
 
128
  <details>
src/f5_tts/infer/infer_gradio.py CHANGED
@@ -875,10 +875,19 @@ If you're having issues, try converting your reference audio to WAV or MP3, clip
875
  type=str,
876
  help='The root path (or "mount point") of the application, if it\'s not served from the root ("/") of the domain. Often used when the application is behind a reverse proxy that forwards requests to the application, e.g. set "/myapp" or full URL for application served at "https://example.com/myapp".',
877
  )
878
- def main(port, host, share, api, root_path):
 
 
 
 
 
 
 
879
  global app
880
  print("Starting app...")
881
- app.queue(api_open=api).launch(server_name=host, server_port=port, share=share, show_api=api, root_path=root_path)
 
 
882
 
883
 
884
  if __name__ == "__main__":
 
875
  type=str,
876
  help='The root path (or "mount point") of the application, if it\'s not served from the root ("/") of the domain. Often used when the application is behind a reverse proxy that forwards requests to the application, e.g. set "/myapp" or full URL for application served at "https://example.com/myapp".',
877
  )
878
+ @click.option(
879
+ "--autolaunch",
880
+ "-l",
881
+ is_flag=True,
882
+ default=False,
883
+ help="Automatically launch the interface in the default web browser",
884
+ )
885
+ def main(port, host, share, api, root_path, autolaunch):
886
  global app
887
  print("Starting app...")
888
+ app.queue(api_open=api).launch(
889
+ server_name=host, server_port=port, share=share, show_api=api, root_path=root_path, inbrowser=autolaunch
890
+ )
891
 
892
 
893
  if __name__ == "__main__":