S-K-yadav commited on
Commit
e38990c
·
1 Parent(s): 9a33b59

Configure for CPU-only zero-gpu deployment

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -4
  2. config.py +5 -5
Dockerfile CHANGED
@@ -2,7 +2,7 @@ FROM python:3.12-slim
2
 
3
  WORKDIR /app
4
 
5
- # System dependencies for audio and Python packages
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  cmake \
@@ -15,10 +15,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
15
  # Copy project files
16
  COPY . /app/
17
 
18
- # Install venv and dependencies
19
- RUN python3 -m venv /opt/venv
20
- ENV PATH="/opt/venv/bin:$PATH"
21
  RUN pip install --upgrade pip setuptools wheel
 
 
 
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
  EXPOSE 7860
 
2
 
3
  WORKDIR /app
4
 
5
+ # System dependencies (CPU-only, no CUDA)
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  cmake \
 
15
  # Copy project files
16
  COPY . /app/
17
 
18
+ # Install dependencies
 
 
19
  RUN pip install --upgrade pip setuptools wheel
20
+ # Install llama-cpp-python without GPU support (CPU-only)
21
+ RUN pip install --no-cache-dir llama-cpp-python --no-build-isolation
22
+ # Install remaining requirements
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
  EXPOSE 7860
config.py CHANGED
@@ -21,13 +21,13 @@ HF_TOKEN = os.environ.get("HF_TOKEN", "")
21
  # ASR: Hugging Face Moonshine
22
  TRANSCRIBE_MODEL_ID = "UsefulSensors/moonshine-tiny"
23
  TRANSCRIBE_LANGUAGE = "en" # Moonshine Tiny is English ASR
24
- TRANSCRIBE_DEVICE = "cuda:0" # falls back to "cpu" automatically in code
25
 
26
  # Intent Parser: Qwen2.5-7B-Instruct (GGUF via llama-cpp-python)
27
- # Using q3_k_m quantization (3.55 GB, good quality/size tradeoff).
28
- # Already downloaded and available in ./models/
29
- QWEN_GGUF_PATH = MODELS_DIR / "qwen2.5-7b-instruct-q3_k_m.gguf"
30
- QWEN_N_GPU_LAYERS = 20 # offload 20 transformer layers to GPU (~0.8 GB VRAM)
31
  QWEN_N_CTX = 4096 # context window sufficient for a call transcript
32
  QWEN_MAX_TOKENS = 512 # max tokens for the structured JSON response
33
  QWEN_TEMPERATURE = 0.1 # near-deterministic for structured output
 
21
  # ASR: Hugging Face Moonshine
22
  TRANSCRIBE_MODEL_ID = "UsefulSensors/moonshine-tiny"
23
  TRANSCRIBE_LANGUAGE = "en" # Moonshine Tiny is English ASR
24
+ TRANSCRIBE_DEVICE = "cpu" # CPU-only for zero-gpu deployment
25
 
26
  # Intent Parser: Qwen2.5-7B-Instruct (GGUF via llama-cpp-python)
27
+ # Using q2_k quantization for smaller size on CPU (~2.3 GB).
28
+ # Download from HF Hub on first run if not cached.
29
+ QWEN_GGUF_PATH = MODELS_DIR / "qwen2.5-7b-instruct-q2_k.gguf"
30
+ QWEN_N_GPU_LAYERS = 0 # CPU-only: no GPU layer offloading
31
  QWEN_N_CTX = 4096 # context window sufficient for a call transcript
32
  QWEN_MAX_TOKENS = 512 # max tokens for the structured JSON response
33
  QWEN_TEMPERATURE = 0.1 # near-deterministic for structured output