soulteary / docker-llama2-chat

Play LLaMA2 (official / 中文版 / INT4 / llama2.cpp) Together! ONLY 3 STEPS! ( non GPU / 5GB vRAM / 8~14GB vRAM)
https://www.zhihu.com/people/soulteary/posts
Apache License 2.0
533 stars 83 forks source link

请问要怎么改docker 网站分享的port 从7860换成其他port #10

Closed ppkliu closed 1 year ago

ppkliu commented 1 year ago

我将docker script port 7860换成8000了, docker run --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 --rm -it -v pwd/LinkSoul:/app/LinkSoul -p 7860:8000 soulteary/llama2:7b-cn

但是启动之后画面还是显示 7860 Running on local URL: http://0.0.0.0:7860

To create a public link, set share=True in launch().

请问这个网站的port mapping 可以更改吗?

ppkliu commented 1 year ago

I answer myself like as following.

  1. modifiy app.py in the model folder like this example: (/llama2-7b-cn/app.py) add server_port=8000 (8000 is your assign port)

    demo.queue(max_size=20).launch(
                         server_name="0.0.0.0",
                         server_port=8000,
  2. re-build the image in build command source /scripts/make-7b-cn.sh

  3. run the port change image source /scripts/run-7b-cn.sh