Aleksandr Maiorov commited on
Commit
3108f29
·
2 Parent(s): 47af0fc 3e20bb6

Merge remote-tracking branch 'origin/main'

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -6
Dockerfile CHANGED
@@ -1,17 +1,22 @@
1
  # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
 
 
 
 
 
 
 
3
 
4
- FROM python:3.9
5
-
6
  RUN useradd -m -u 1000 user
7
  USER user
8
  ENV PATH="/home/user/.local/bin:$PATH"
9
 
10
- WORKDIR /app
11
-
12
  COPY --chown=user ./requirements.txt requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
- RUN pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
15
 
16
  COPY --chown=user . /app
17
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
+ FROM ghcr.io/ggerganov/llama.cpp:server
4
+ ENV LLAMA_ARG_MODEL_URL=https://huggingface.co/Vikhrmodels/Vikhr-Qwen-2.5-1.5B-Instruct-GGUF/resolve/main/Vikhr-Qwen-2.5-1.5b-Instruct-Q8_0.gguf \
5
+ LLAMA_ARG_CTX_SIZE=4096 \
6
+ LLAMA_ARG_N_PARALLEL=2 \
7
+ LLAMA_ARG_ENDPOINT_METRICS=1 \
8
+ LLAMA_ARG_PORT=8080
9
+ RUN ./llama-server --host 0.0.0.0
10
 
11
+ WORKDIR /app
12
+ FROM python:3.11-slim as builder
13
  RUN useradd -m -u 1000 user
14
  USER user
15
  ENV PATH="/home/user/.local/bin:$PATH"
16
 
 
 
17
  COPY --chown=user ./requirements.txt requirements.txt
18
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
19
 
20
  COPY --chown=user . /app
21
+
22
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]