CooLLaMACEO commited on
Commit
0122415
·
verified ·
1 Parent(s): c828ba8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -13
Dockerfile CHANGED
@@ -1,31 +1,27 @@
1
- # Base image
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Install runtime dependencies only (keep it slim)
8
  RUN apt-get update && apt-get install -y \
9
  wget \
10
- curl \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Install FastAPI, uvicorn, and llama-cpp-python prebuilt wheel (CPU)
14
  RUN pip install --no-cache-dir \
15
  fastapi \
16
- uvicorn \
17
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
18
- llama-cpp-python==0.1.81
19
 
20
- # Download the MPT-7B quantized model
21
  RUN wget -q -O mpt-7b-q2.gguf \
22
  "https://huggingface.co/maddes8cht/mosaicml-mpt-7b-chat-gguf/resolve/main/mosaicml-mpt-7b-chat-Q2_K.gguf?download=true"
23
 
24
- # Copy your FastAPI app
25
  COPY app.py .
26
 
27
- # Expose the port HF Spaces expects
28
- EXPOSE 8080
29
 
30
- # Run the app
31
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # Install wget and build tools
6
  RUN apt-get update && apt-get install -y \
7
  wget \
8
+ git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Install Python dependencies
12
  RUN pip install --no-cache-dir \
13
  fastapi \
14
+ uvicorn[standard] \
15
+ torch \
16
+ transformers
17
 
18
+ # Download model (example GGUF from Hugging Face)
19
  RUN wget -q -O mpt-7b-q2.gguf \
20
  "https://huggingface.co/maddes8cht/mosaicml-mpt-7b-chat-gguf/resolve/main/mosaicml-mpt-7b-chat-Q2_K.gguf?download=true"
21
 
22
+ # Copy app
23
  COPY app.py .
24
 
25
+ EXPOSE 7860
 
26
 
 
27
  CMD ["python", "app.py"]