add subpath support

This commit is contained in:
catalpaaa
2023-04-25 07:27:24 -07:00
parent 22bcc7be42
commit b2f6e0704e
3 changed files with 6 additions and 0 deletions

View File

@@ -290,6 +290,11 @@ def webui():
print(f"Startup time: {startup_timer.summary()}.")
if cmd_opts.subpath:
redirector = FastAPI()
redirector.get("/")
mounted_app = gradio.mount_gradio_app(redirector, shared.demo, path=f"/{cmd_opts.subpath}")
wait_on_server(shared.demo)
print('Restarting UI...')