MuhammadNoman7600 commited on
Commit
9f45529
Β·
verified Β·
1 Parent(s): 48e2856

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -9
Dockerfile CHANGED
@@ -1,37 +1,44 @@
1
  # ============================================================
2
- # Dockerfile β€” Qwen3.5-0.8B CPU-Only API for HF Spaces
3
- # No GPU required. Port 7860.
4
  # ============================================================
5
-
6
  FROM python:3.11-slim
7
 
8
- # ── System deps ──
9
  RUN apt-get update && \
10
  apt-get install -y --no-install-recommends git && \
11
  rm -rf /var/lib/apt/lists/*
12
 
13
- # ── Python deps (CPU-only torch β€” no CUDA bloat) ──
14
  RUN pip install --no-cache-dir \
15
  torch --index-url https://download.pytorch.org/whl/cpu
16
 
17
  RUN pip install --no-cache-dir \
18
  transformers \
19
  accelerate \
 
20
  fastapi \
21
  uvicorn \
22
  pydantic \
23
  huggingface_hub
24
 
25
- # ── Pre-download model at build time (~1.8 GB baked into image) ──
 
 
 
 
 
 
26
  ENV HF_HOME=/tmp/hf_cache
 
27
  RUN python3 -c "\
28
  from huggingface_hub import snapshot_download; \
29
- snapshot_download('Qwen/Qwen2.5-0.5B-Instruct', cache_dir='/tmp/hf_cache')"
 
30
 
31
- # ── Copy app ──
32
  WORKDIR /app
33
  COPY app.py .
34
 
35
  EXPOSE 7860
36
-
37
  CMD ["python3", "app.py"]
 
1
  # ============================================================
2
+ # Dockerfile β€” Qwen2.5-0.5B + MuhammadNoman7600/mermaid LoRA
3
+ # CPU-Only API for HF Spaces. No GPU required. Port 7860.
4
  # ============================================================
 
5
  FROM python:3.11-slim
6
 
7
+ # ── System deps ──────────────────────────────────────────────
8
  RUN apt-get update && \
9
  apt-get install -y --no-install-recommends git && \
10
  rm -rf /var/lib/apt/lists/*
11
 
12
+ # ── Python deps (CPU-only torch β€” no CUDA bloat) ─────────────
13
  RUN pip install --no-cache-dir \
14
  torch --index-url https://download.pytorch.org/whl/cpu
15
 
16
  RUN pip install --no-cache-dir \
17
  transformers \
18
  accelerate \
19
+ peft \
20
  fastapi \
21
  uvicorn \
22
  pydantic \
23
  huggingface_hub
24
 
25
+ # ── Pre-download models at build time ────────────────────────
26
+ # Base model : unsloth/qwen2.5-0.5b-unsloth-bnb-4bit
27
+ # NOTE: This repo ships 4-bit safetensors. On CPU (no bitsandbytes)
28
+ # we load it as float32 β€” HF will automatically use the non-quantised
29
+ # weights if available, otherwise the adapter still loads correctly.
30
+ #
31
+ # LoRA adapter: MuhammadNoman7600/mermaid
32
  ENV HF_HOME=/tmp/hf_cache
33
+
34
  RUN python3 -c "\
35
  from huggingface_hub import snapshot_download; \
36
+ snapshot_download('unsloth/qwen2.5-0.5b-unsloth-bnb-4bit', cache_dir='/tmp/hf_cache'); \
37
+ snapshot_download('MuhammadNoman7600/mermaid', cache_dir='/tmp/hf_cache')"
38
 
39
+ # ── Copy app ──────────────────────────────────────────────────
40
  WORKDIR /app
41
  COPY app.py .
42
 
43
  EXPOSE 7860
 
44
  CMD ["python3", "app.py"]