From 0594d9cdc2187e3475666f380e769aaf99ebc936 Mon Sep 17 00:00:00 2001 From: Jakub Filo Date: Thu, 13 Feb 2025 23:27:31 +0100 Subject: [PATCH 1/2] Add option to set root path --- webui.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webui.py b/webui.py index a3aaeb1..4a8e107 100644 --- a/webui.py +++ b/webui.py @@ -59,6 +59,13 @@ default=None, help="TabbyAPI admin key, connect automatically on launch", ) +parser.add_argument( + "-r", + "--root_path", + type=str, + default=None, + help="Root path", +) args = parser.parse_args() if args.listen: host_url = "0.0.0.0" @@ -1055,4 +1062,5 @@ def cancel_download(): server_name=host_url, server_port=args.port, share=args.share, + root_path=args.root_path, ) From 2c4b106866a874602889ede9bddacaf1456f6550 Mon Sep 17 00:00:00 2001 From: Jakub Filo Date: Thu, 13 Feb 2025 23:33:35 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7e29615..c3a1108 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,13 @@ To get started, make sure you have the following installed on your system: 3. Input your tabbyAPI endpoint URL and admin key and press connect! ## Command-line Arguments -| Argument | Description | -| :----------------------- | :----------------------------------------------------------- | -| `-h` or`--help` | Show this help message and exit | -| `-p` or `--port` | Specify port to host the WebUI on (default 7860) | -| `-l` or `--listen` | Share WebUI link via LAN | -| `-s` or `--share` | Share WebUI link remotely via Gradio's built in tunnel | -| `-a` or `--autolaunch` | Launch browser after starting WebUI | -| `-e` or `--endpoint_url` | TabbyAPI endpoint URL (default http://localhost:5000) | -| `-k` or `--admin_key` | TabbyAPI admin key, connect automatically on launch | +| Argument | Description | +| :----------------------- | :---------------------------------------------------------------------------------------------- | +| `-h` or`--help` | Show this help message and exit | +| `-p` or `--port` | Specify port to host the WebUI on (default 7860) | +| `-l` or `--listen` | Share WebUI link via LAN | +| `-s` or `--share` | Share WebUI link remotely via Gradio's built in tunnel | +| `-a` or `--autolaunch` | Launch browser after starting WebUI | +| `-e` or `--endpoint_url` | TabbyAPI endpoint URL (default http://localhost:5000) | +| `-k` or `--admin_key` | TabbyAPI admin key, connect automatically on launch | +| `-r` or `--root_path` | Sets the root path for the Gradio application. Useful if running Gradio behind a reverse proxy. |