Yushen CHEN commited on
Commit
d10cce5
·
2 Parent(s): 2e28245 beab389

Merge pull request #526 from techknowfile/main

Browse files

Add root_path argument to support reverse proxies

Files changed (1) hide show
  1. src/f5_tts/infer/infer_gradio.py +9 -2
src/f5_tts/infer/infer_gradio.py CHANGED
@@ -831,10 +831,17 @@ If you're having issues, try converting your reference audio to WAV or MP3, clip
831
  help="Share the app via Gradio share link",
832
  )
833
  @click.option("--api", "-a", default=True, is_flag=True, help="Allow API access")
834
- def main(port, host, share, api):
 
 
 
 
 
 
 
835
  global app
836
  print("Starting app...")
837
- app.queue(api_open=api).launch(server_name=host, server_port=port, share=share, show_api=api)
838
 
839
 
840
  if __name__ == "__main__":
 
831
  help="Share the app via Gradio share link",
832
  )
833
  @click.option("--api", "-a", default=True, is_flag=True, help="Allow API access")
834
+ @click.option(
835
+ "--root_path",
836
+ "-r",
837
+ default=None,
838
+ type=str,
839
+ 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".',
840
+ )
841
+ def main(port, host, share, api, root_path):
842
  global app
843
  print("Starting app...")
844
+ app.queue(api_open=api).launch(server_name=host, server_port=port, share=share, show_api=api, root_path=root_path)
845
 
846
 
847
  if __name__ == "__main__":