mirror of https://github.com/THUDM/ChatGLM2-6B
add docker deployment
parent
3a534decf2
commit
db43bce59c
|
@ -10,7 +10,7 @@ services:
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
ports:
|
ports:
|
||||||
- "9000:8000"
|
- "9000:8000"
|
||||||
command: bash -c "python api.py"
|
command: bash -c "python web_demo.py"
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
reservations:
|
reservations:
|
||||||
|
|
|
@ -9,8 +9,10 @@ RUN apt update && apt-get -y install git wget \
|
||||||
RUN ln -s /usr/bin/python3.10 /usr/bin/python
|
RUN ln -s /usr/bin/python3.10 /usr/bin/python
|
||||||
RUN useradd -ms /bin/bash usera
|
RUN useradd -ms /bin/bash usera
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ADD . .
|
ADD .requirements .
|
||||||
RUN pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple
|
RUN pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple
|
||||||
RUN pip config set global.trusted-host mirrors.cloud.tencent.com
|
RUN pip config set global.trusted-host mirrors.cloud.tencent.com
|
||||||
RUN pip install -r requirements.txt --no-cache-dir
|
RUN pip install -r requirements.txt --no-cache-dir
|
||||||
|
ADD . .
|
||||||
|
# preinstall model
|
||||||
|
RUN python -c "from transformers import AutoTokenizer, AutoModel; AutoModel.from_pretrained('THUDM/chatglm2-6b', trust_remote_code=True)"
|
Loading…
Reference in New Issue