Alex0007 commited on
Commit
0e486fd
1 Parent(s): 274c38a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -11
Dockerfile CHANGED
@@ -2,12 +2,12 @@
2
  FROM ubuntu:22.04
3
 
4
  # Environment variables
5
- ENV CACHE_SIZE=16000
6
  ENV MODEL_NAME="Qwen-7B-gguf"
7
  ENV MODEL_FILE="qwen7b-q4_0.gguf"
8
  ENV MODEL_USER="MatrixStudio"
9
  ENV DEFAULT_MODEL_BRANCH="main"
10
  ENV MODEL_URL="https://huggingface.co/${MODEL_USER}/${MODEL_NAME}/resolve/${DEFAULT_MODEL_BRANCH}/${MODEL_FILE}"
 
11
 
12
  # Installing necessary packages
13
  RUN apt-get update && apt-get upgrade -y \
@@ -25,16 +25,8 @@ RUN git clone https://github.com/ggerganov/llama.cpp.git
25
  WORKDIR /app/llama.cpp
26
  RUN make
27
 
28
- # List contents to verify the location of the server executable
29
- RUN ls -la
30
-
31
  # Model download process
32
- RUN mkdir -p models/7B && \
33
- wget -O models/7B/${MODEL_FILE} ${MODEL_URL}
34
-
35
- # List contents to verify the location of the server executable
36
- RUN pwd
37
- RUN ls -la models/7B/
38
 
39
  # Changing ownership to a non-root user
40
  RUN useradd -m -u 1000 user && chown -R user:user /app
@@ -47,4 +39,4 @@ RUN chmod -R 777 /app/llama.cpp
47
  EXPOSE 8080
48
 
49
  # Adjust the CMD to use the absolute path of the server executable
50
- CMD ["/app/llama.cpp/server", "-m", "/app/llama.cpp/models/7B/${MODEL_FILE}", "-c", "16000"]
 
2
  FROM ubuntu:22.04
3
 
4
  # Environment variables
 
5
  ENV MODEL_NAME="Qwen-7B-gguf"
6
  ENV MODEL_FILE="qwen7b-q4_0.gguf"
7
  ENV MODEL_USER="MatrixStudio"
8
  ENV DEFAULT_MODEL_BRANCH="main"
9
  ENV MODEL_URL="https://huggingface.co/${MODEL_USER}/${MODEL_NAME}/resolve/${DEFAULT_MODEL_BRANCH}/${MODEL_FILE}"
10
+ ENV MODEL_PATH="/app/llama.cpp/models/7B/${MODEL_FILE}"
11
 
12
  # Installing necessary packages
13
  RUN apt-get update && apt-get upgrade -y \
 
25
  WORKDIR /app/llama.cpp
26
  RUN make
27
 
 
 
 
28
  # Model download process
29
+ RUN mkdir -p models/7B && wget -O models/7B/${MODEL_FILE} ${MODEL_URL}
 
 
 
 
 
30
 
31
  # Changing ownership to a non-root user
32
  RUN useradd -m -u 1000 user && chown -R user:user /app
 
39
  EXPOSE 8080
40
 
41
  # Adjust the CMD to use the absolute path of the server executable
42
+ CMD ["/app/llama.cpp/server", "-m", "${MODEL_PATH}", "-c", "16000"]