mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-07 11:46:51 +08:00
fix static paths and demo launch
This commit is contained in:
parent
18a75e409c
commit
82b377483c
@ -1 +1,7 @@
|
||||
__webpack_public_path__ = window.gradio_mode == "app" ? "/" : "https://gradio.s3-us-west-2.amazonaws.com/" + process.env.REACT_APP_VERSION + "/";
|
||||
if (window.gradio_mode === "app") {
|
||||
__webpack_public_path__ = "/";
|
||||
} else if (window.gradio_mode === "website") {
|
||||
__webpack_public_path__ = "gradio_static/"
|
||||
} else {
|
||||
__webpack_public_path__ = "https://gradio.s3-us-west-2.amazonaws.com/" + process.env.REACT_APP_VERSION + "/";
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ for demo_name, port in demo_port_sets:
|
||||
with open(demo_file, 'r') as file:
|
||||
filedata = file.read()
|
||||
filedata = filedata.replace(
|
||||
f'if __name__ == "__main__":',
|
||||
f'if __name__ == "__main__":\n iface.server_port={port}')
|
||||
f'iface.launch()',
|
||||
f'iface.launch(server_port={port})')
|
||||
with open(demo_file, 'w') as file:
|
||||
file.write(filedata)
|
||||
demo_thread = threading.Thread(target=launch_demo, args=(demo_folder,))
|
||||
|
Loading…
Reference in New Issue
Block a user