cakebut commited on
Commit
e1ef9b6
·
verified ·
1 Parent(s): 0fd7d40

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -13
Dockerfile CHANGED
@@ -1,19 +1,26 @@
1
- FROM python:3.10-slim
 
2
 
3
- WORKDIR /home/user/app
 
 
 
 
 
 
4
 
5
- RUN pip install --no-cache-dir huggingface_hub
 
6
 
7
- # Install llama-cpp-python with OpenAI-style server support
8
- RUN pip install --no-cache-dir \
9
- "llama-cpp-python[server]==0.2.30" \
10
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
11
 
12
- # Download model
13
- RUN python3 -c "from huggingface_hub import hf_hub_download; \
14
- hf_hub_download(repo_id='cakebut/askvox_api', filename='llama-2-7b-chat.Q4_K_M.gguf', local_dir='.', local_dir_use_symlinks=False)"
15
 
16
- RUN mv llama-2-7b-chat.Q4_K_M.gguf model.gguf
 
17
 
18
- # Start OpenAI-compatible server (fixed single-line CMD)
19
- CMD ["python3", "-m", "llama_cpp.server", "--model", "model.gguf", "--host", "0.0.0.0", "--port", "7860", "--chat_format", "llama-2", "--n_ctx", "2048"]
 
1
+ # Use Python base image (with CUDA if GPU needed)
2
+ FROM python:3.11-slim
3
 
4
+ # Install system dependencies
5
+ RUN apt-get update && apt-get install -y \
6
+ build-essential \
7
+ cmake \
8
+ wget \
9
+ git \
10
+ && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Set working directory
13
+ WORKDIR /app
14
 
15
+ # Copy your model and code into the container
16
+ COPY . /app
 
 
17
 
18
+ # Install Python dependencies
19
+ RUN pip install --no-cache-dir --upgrade pip
20
+ RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Expose port for HF Space
23
+ EXPOSE 7860
24
 
25
+ # Command to run your app
26
+ CMD ["python", "app.py"]