修改二级路径运行的说明
This commit is contained in:
parent
a0f15f1512
commit
70bd21f09a
@ -2,26 +2,41 @@
|
|||||||
|
|
||||||
We currently support fastapi in order to solve sub-path deploy issue.
|
We currently support fastapi in order to solve sub-path deploy issue.
|
||||||
|
|
||||||
1. checkout to `subpath` branch
|
1. change CUSTOM_PATH setting in `config.py`
|
||||||
|
|
||||||
``` sh
|
|
||||||
git checkout subpath
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
2. merge lastest features (optional)
|
|
||||||
|
|
||||||
``` sh
|
|
||||||
git merge master
|
|
||||||
```
|
|
||||||
|
|
||||||
3. change CUSTOM_PATH setting in `config.py`
|
|
||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
nano config.py
|
nano config.py
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Go!
|
2. Edit main.py
|
||||||
|
|
||||||
|
```diff
|
||||||
|
auto_opentab_delay()
|
||||||
|
- demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION, favicon_path="docs/logo.png")
|
||||||
|
+ demo.queue(concurrency_count=CONCURRENT_COUNT)
|
||||||
|
|
||||||
|
- # 如果需要在二级路径下运行
|
||||||
|
- # CUSTOM_PATH, = get_conf('CUSTOM_PATH')
|
||||||
|
- # if CUSTOM_PATH != "/":
|
||||||
|
- # from toolbox import run_gradio_in_subpath
|
||||||
|
- # run_gradio_in_subpath(demo, auth=AUTHENTICATION, port=PORT, custom_path=CUSTOM_PATH)
|
||||||
|
- # else:
|
||||||
|
- # demo.launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION, favicon_path="docs/logo.png")
|
||||||
|
|
||||||
|
+ 如果需要在二级路径下运行
|
||||||
|
+ CUSTOM_PATH, = get_conf('CUSTOM_PATH')
|
||||||
|
+ if CUSTOM_PATH != "/":
|
||||||
|
+ from toolbox import run_gradio_in_subpath
|
||||||
|
+ run_gradio_in_subpath(demo, auth=AUTHENTICATION, port=PORT, custom_path=CUSTOM_PATH)
|
||||||
|
+ else:
|
||||||
|
+ demo.launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION, favicon_path="docs/logo.png")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
3. Go!
|
||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
python main.py
|
python main.py
|
||||||
|
Loading…
x
Reference in New Issue
Block a user