From 39c65a5c45d951eba2aef75a991acca61adabd8a Mon Sep 17 00:00:00 2001 From: Andy Dudley Date: Mon, 25 Nov 2024 20:46:51 -0800 Subject: [PATCH 1/5] Add root_path argument to support reverse proxies --- src/f5_tts/infer/infer_gradio.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/f5_tts/infer/infer_gradio.py b/src/f5_tts/infer/infer_gradio.py index 4e5dc63..dd0f031 100644 --- a/src/f5_tts/infer/infer_gradio.py +++ b/src/f5_tts/infer/infer_gradio.py @@ -831,11 +831,11 @@ If you're having issues, try converting your reference audio to WAV or MP3, clip 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 of the gradio application if it's not served from the root (\"/\") of the domain. Set this value if the application is behind a reverse proxy that forwards the request to a subdirectory of the domain.") +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__": if not USING_SPACES: From dbd54bb310bd644f8f6d710bb81a3962145dff14 Mon Sep 17 00:00:00 2001 From: Yushen CHEN <45333109+SWivid@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:54:44 +0800 Subject: [PATCH 2/5] Update infer_gradio.py; help --- src/f5_tts/infer/infer_gradio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/f5_tts/infer/infer_gradio.py b/src/f5_tts/infer/infer_gradio.py index dd0f031..e4f0ce5 100644 --- a/src/f5_tts/infer/infer_gradio.py +++ b/src/f5_tts/infer/infer_gradio.py @@ -831,7 +831,7 @@ If you're having issues, try converting your reference audio to WAV or MP3, clip help="Share the app via Gradio share link", ) @click.option("--api", "-a", default=True, is_flag=True, help="Allow API access") -@click.option("--root_path", "-r", default=None, type=str, help="The root path of the gradio application if it's not served from the root (\"/\") of the domain. Set this value if the application is behind a reverse proxy that forwards the request to a subdirectory of the domain.") +@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...") From a5c44ee5e2d8e82571fc26c6bb6b533c8cc79ddf Mon Sep 17 00:00:00 2001 From: Yushen CHEN <45333109+SWivid@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:56:19 +0800 Subject: [PATCH 3/5] Update infer_gradio.py; help-1 --- src/f5_tts/infer/infer_gradio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/f5_tts/infer/infer_gradio.py b/src/f5_tts/infer/infer_gradio.py index e4f0ce5..7457f2f 100644 --- a/src/f5_tts/infer/infer_gradio.py +++ b/src/f5_tts/infer/infer_gradio.py @@ -831,7 +831,7 @@ If you're having issues, try converting your reference audio to WAV or MP3, clip help="Share the app via Gradio share link", ) @click.option("--api", "-a", default=True, is_flag=True, help="Allow API access") -@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\".") +@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...") From d96bd6f99c809e0cc21e0a605c4945d165cc0d6e Mon Sep 17 00:00:00 2001 From: Yushen CHEN <45333109+SWivid@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:00:24 +0800 Subject: [PATCH 4/5] Update infer_gradio.py; formatting --- src/f5_tts/infer/infer_gradio.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/f5_tts/infer/infer_gradio.py b/src/f5_tts/infer/infer_gradio.py index 7457f2f..7eeb1c2 100644 --- a/src/f5_tts/infer/infer_gradio.py +++ b/src/f5_tts/infer/infer_gradio.py @@ -831,7 +831,13 @@ If you're having issues, try converting your reference audio to WAV or MP3, clip help="Share the app via Gradio share link", ) @click.option("--api", "-a", default=True, is_flag=True, help="Allow API access") -@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\".") +@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...") From c066c324ca493c0ffb82215fda36829e6bd066e3 Mon Sep 17 00:00:00 2001 From: Yushen CHEN <45333109+SWivid@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:05:07 +0800 Subject: [PATCH 5/5] Update infer_gradio.py; formatting-1 --- src/f5_tts/infer/infer_gradio.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/f5_tts/infer/infer_gradio.py b/src/f5_tts/infer/infer_gradio.py index 7eeb1c2..869a736 100644 --- a/src/f5_tts/infer/infer_gradio.py +++ b/src/f5_tts/infer/infer_gradio.py @@ -843,6 +843,7 @@ def main(port, host, share, api, root_path): print("Starting app...") app.queue(api_open=api).launch(server_name=host, server_port=port, share=share, show_api=api, root_path=root_path) + if __name__ == "__main__": if not USING_SPACES: main()