Skip to content

Commit

Permalink
Merge pull request #526 from techknowfile/main
Browse files Browse the repository at this point in the history
Add root_path argument to support reverse proxies
  • Loading branch information
SWivid authored Nov 26, 2024
2 parents c9b4d43 + c066c32 commit d81911b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/f5_tts/infer/infer_gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,17 @@ def set_custom_model(custom_ckpt_path, custom_vocab_path):
help="Share the app via Gradio share link",
)
@click.option("--api", "-a", default=True, is_flag=True, help="Allow API access")
def main(port, host, share, api):
@click.option(
"--root_path",
"-r",
default=None,
type=str,
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".',
)
def main(port, host, share, api, root_path):
global app
print("Starting app...")
app.queue(api_open=api).launch(server_name=host, server_port=port, share=share, show_api=api)
app.queue(api_open=api).launch(server_name=host, server_port=port, share=share, show_api=api, root_path=root_path)


if __name__ == "__main__":
Expand Down

0 comments on commit d81911b

Please sign in to comment.