CooLLaMACEO commited on
Commit
3294758
·
verified ·
1 Parent(s): 5ddd6af

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -8
Dockerfile CHANGED
@@ -1,22 +1,30 @@
1
- # Use the official pre-compiled image (CPU version)
2
  FROM ghcr.io/abetlen/llama-cpp-python:latest
3
 
4
  WORKDIR /app
5
 
6
- # 1. Install curl and move to the right folder
7
  RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
8
 
9
- # 2. Download the model using the CLI (most stable)
10
- RUN pip install huggingface_hub
11
- RUN huggingface-cli download maddes8cht/mosaicml-mpt-7b-chat-gguf mosaicml-mpt-7b-chat-Q2_K.gguf --local-dir . --local-dir-use-symlinks False
 
 
 
 
 
 
 
 
 
12
  RUN mv mosaicml-mpt-7b-chat-Q2_K.gguf mpt-7b-q2.gguf
13
 
14
- # 3. Copy your app code
15
  COPY app.py .
16
 
17
- # Force the port to 7860 for Hugging Face
18
  ENV PORT=7860
19
  EXPOSE 7860
20
 
21
- # Use the python inside the container to run your app
22
  CMD ["python3", "app.py"]
 
1
+ # Use official pre-compiled binary image to skip building from source
2
  FROM ghcr.io/abetlen/llama-cpp-python:latest
3
 
4
  WORKDIR /app
5
 
6
+ # 1. Install system essentials
7
  RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
8
 
9
+ # 2. Install downloader tool
10
+ RUN pip install --no-cache-dir huggingface_hub
11
+
12
+ # 3. Download MPT-7B Q2 using the module path (Fixes the "not found" error)
13
+ # This will download the 2.8GB file. If it looks stuck, give it 5-10 minutes!
14
+ RUN python3 -m huggingface_hub.commands.user download \
15
+ maddes8cht/mosaicml-mpt-7b-chat-gguf \
16
+ mosaicml-mpt-7b-chat-Q2_K.gguf \
17
+ --local-dir . \
18
+ --local-dir-use-symlinks False
19
+
20
+ # 4. Rename file to match what app.py expects
21
  RUN mv mosaicml-mpt-7b-chat-Q2_K.gguf mpt-7b-q2.gguf
22
 
23
+ # 5. Copy your backend code
24
  COPY app.py .
25
 
26
+ # Standard Hugging Face configuration
27
  ENV PORT=7860
28
  EXPOSE 7860
29
 
 
30
  CMD ["python3", "app.py"]