File size: 1,550 Bytes
05bcfa9
 
 
 
 
 
 
dc00afc
05bcfa9
 
 
dc00afc
05bcfa9
dc00afc
05bcfa9
 
 
 
b9e5837
0aaccff
7a5c40d
05bcfa9
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
ENV DEBIAN_FRONTEND noninteractive

WORKDIR /usr/local/src
ENV dir=/usr/local/src/MiniGPT-4
ENV llama_version=llama-7b-hf
ENV vicuna_diff=vicuna-7b-delta-v1.1
COPY requriments-7b.txt pretrained_minigpt4_7b.pth .

RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libgl1 libglib2.0-0 wget git git-lfs python3-pip python-is-python3 && pip3 install --upgrade pip
RUN pip install torch==1.12.1 torchaudio==0.12.1 torchvision==0.13.1
RUN pip install -r requriments-7b.txt \
    && git clone https://github.com/Vision-CAIR/MiniGPT-4.git \ 
    && sed -i -e '11c\ \ ckpt: "/usr/local/src/MiniGPT-4/pretrained_minigpt4_7b.pth"' ${dir}/eval_configs/minigpt4_eval.yaml \
    && cd MiniGPT-4 \
    && git lfs install \
    && git clone https://huggingface.co/lmsys/${vicuna_diff} \
    && git clone https://huggingface.co/decapoda-research/${llama_version} \
    && pip install git+https://github.com/lm-sys/FastChat.git@v0.2.1 \
    && sed -i 's/LLaMATokenizer/LlamaTokenizer/' ${llama_version}/tokenizer_config.json \
    && python -m fastchat.model.apply_delta --base ${dir}/${llama_version}/  --target ${dir}/vicuna_out  --delta ${dir}/${vicuna_diff}/ \
    && sed -i -e '16c\ \ llama_model: "/usr/local/src/MiniGPT-4/vicuna_out"' ${dir}/minigpt4/configs/models/minigpt4.yaml 

RUN adduser --disabled-password --gecos '' user
RUN chown -R user:user ${dir}
RUN chmod -R 777 ${dir}
USER user

EXPOSE 7860
ENTRYPOINT [cd MiniGPT-4 && python, 'demo.py', '--cfg-path', 'eval_configs/minigpt4_eval.yaml']