CooLLaMACEO commited on
Commit
1d1f01c
·
verified ·
1 Parent(s): 919d792

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -9
Dockerfile CHANGED
@@ -1,21 +1,24 @@
1
- # Use the standard Python image (not the 'slim' one, to avoid manual installs)
 
2
  FROM python:3.10
3
 
 
4
  WORKDIR /app
5
 
6
- # Upgrade pip and install the core AI library first (the heavy part)
7
- # This will use the pre-built version so it finishes in seconds
8
- RUN pip install --upgrade pip && \
9
- pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
10
 
11
- # Install your other web requirements
12
  COPY requirements.txt .
13
- RUN pip install -r requirements.txt
14
 
15
- # Copy your code and run
16
  COPY . .
17
 
18
- # Expose the port Hugging Face expects
19
  EXPOSE 7860
20
 
 
21
  CMD ["python", "app.py"]
 
1
+ # We use 'python:3.10' instead of 'slim' because the standard version
2
+ # already has most tools installed, so we don't have to wait for 'apt-get'.
3
  FROM python:3.10
4
 
5
+ # Set a working directory
6
  WORKDIR /app
7
 
8
+ # Step 1: Install llama-cpp-python using the PRE-COMPILED link.
9
+ # This is the "Magic Trick" to skip the 15-minute build.
10
+ RUN pip install --no-cache-dir llama-cpp-python \
11
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
12
 
13
+ # Step 2: Install your other requirements
14
  COPY requirements.txt .
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Step 3: Copy your code
18
  COPY . .
19
 
20
+ # Hugging Face Spaces must run on port 7860
21
  EXPOSE 7860
22
 
23
+ # Run your app
24
  CMD ["python", "app.py"]