Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add root_path argument to gradio web server. #2807

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions fastchat/serve/gradio_web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,11 @@ def build_demo(models):
type=str,
help='Set the gradio authentication file path. The file should contain one or more user:password pairs in this format: "u1:p1,u2:p2,u3:p3"',
)
parser.add_argument(
"--gradio-root-path",
type=str,
help="Sets the gradio root path, eg /abc/def. Useful when running behind a reverse-proxy or at a custom URL path prefix"
)
args = parser.parse_args()
logger.info(f"args: {args}")

Expand Down Expand Up @@ -863,4 +868,5 @@ def build_demo(models):
share=args.share,
max_threads=200,
auth=auth,
root_path=args.gradio_root_path
)
6 changes: 6 additions & 0 deletions fastchat/serve/gradio_web_server_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ def build_demo(models, elo_results_file, leaderboard_table_file):
parser.add_argument(
"--leaderboard-table-file", type=str, help="Load leaderboard results and plots"
)
parser.add_argument(
"--gradio-root-path",
type=str,
help="Sets the gradio root path, eg /abc/def. Useful when running behind a reverse-proxy or at a custom URL path prefix"
)
args = parser.parse_args()
logger.info(f"args: {args}")

Expand Down Expand Up @@ -267,4 +272,5 @@ def build_demo(models, elo_results_file, leaderboard_table_file):
share=args.share,
max_threads=200,
auth=auth,
root_path=args.gradio_root_path
)