viskav commited on
Commit
fe16b14
·
verified ·
1 Parent(s): a3ec65b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -17
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
  # ================================
2
- # Base image (HF Spaces compatible)
3
  # ================================
4
  FROM python:3.10-slim
5
 
@@ -19,7 +19,6 @@ RUN apt-get update && apt-get install -y \
19
  ENV PYTHONDONTWRITEBYTECODE=1
20
  ENV PYTHONUNBUFFERED=1
21
 
22
- # Thread & context tuning (CPU)
23
  ENV N_THREADS=8
24
  ENV N_CTX=2048
25
  ENV N_BATCH=256
@@ -30,34 +29,23 @@ ENV N_BATCH=256
30
  WORKDIR /code
31
 
32
  # ================================
33
- # Copy requirements first (cache)
34
  # ================================
35
  COPY requirements.txt /code/requirements.txt
36
-
37
- # ================================
38
- # Install Python dependencies
39
- # ================================
40
  RUN pip install --no-cache-dir --upgrade pip \
41
  && pip install --no-cache-dir -r requirements.txt
42
 
43
  # ================================
44
- # Copy application code
45
  # ================================
46
  COPY app.py /code/app.py
47
 
48
  # ================================
49
- # Copy model file
50
- # IMPORTANT:
51
- # The GGUF file MUST exist in repo
52
- # ================================
53
- COPY Phi-3.1-mini-4k-instruct-IQ2_M.gguf /code/
54
-
55
- # ================================
56
- # Expose FastAPI port
57
  # ================================
58
  EXPOSE 7860
59
 
60
  # ================================
61
- # Start FastAPI app
62
  # ================================
63
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # ================================
2
+ # Base image
3
  # ================================
4
  FROM python:3.10-slim
5
 
 
19
  ENV PYTHONDONTWRITEBYTECODE=1
20
  ENV PYTHONUNBUFFERED=1
21
 
 
22
  ENV N_THREADS=8
23
  ENV N_CTX=2048
24
  ENV N_BATCH=256
 
29
  WORKDIR /code
30
 
31
  # ================================
32
+ # Install Python deps
33
  # ================================
34
  COPY requirements.txt /code/requirements.txt
 
 
 
 
35
  RUN pip install --no-cache-dir --upgrade pip \
36
  && pip install --no-cache-dir -r requirements.txt
37
 
38
  # ================================
39
+ # Copy app
40
  # ================================
41
  COPY app.py /code/app.py
42
 
43
  # ================================
44
+ # Expose port
 
 
 
 
 
 
 
45
  # ================================
46
  EXPOSE 7860
47
 
48
  # ================================
49
+ # Start app
50
  # ================================
51
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]