#Usage:
#1.build image:
#   docker build -f Dockerfile-llama -t llama_image .
#2.run  image:   
#   docker run -it --security-opt seccomp=unconfined llama_image:latest

#base image
FROM openeuler/openeuler:22.03

#update openEuler2309 source  and install chatglm
RUN echo '[everything]' > /etc/yum.repos.d/openEuler.repo  && \
echo 'name=everything' >> /etc/yum.repos.d/openEuler.repo && \
echo 'baseurl=http://121.36.84.172/dailybuild/EBS-openEuler-23.09/rc4_openeuler-2023-09-13-21-46-47/everything/$basearch/' >> /etc/yum.repos.d/openEuler.repo && \
echo 'enabled=1' >> /etc/yum.repos.d/openEuler.repo && \
echo 'gpgcheck=0' >> /etc/yum.repos.d/openEuler.repo && \  
yum install -y llama.cpp wget

#download ggml model 
WORKDIR /model_path
RUN  wget -P /model_path https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/llama-2-13b-chat.ggmlv3.q4_0.bin

# run ggml model
CMD /usr/bin/llama_cpp_main -m /model_path/llama-2-13b-chat.ggmlv3.q4_0.bin --color --ctx_size 2048 -n -1 -ins -b 256 --top_k 10000 --temp 0.2 --repeat_penalty 1.1 -t 8

