Spaces:
Running
Running
Configure for CPU-only zero-gpu deployment
Browse files- Dockerfile +5 -4
- config.py +5 -5
Dockerfile
CHANGED
|
@@ -2,7 +2,7 @@ FROM python:3.12-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# System dependencies
|
| 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
|
| 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 = "
|
| 25 |
|
| 26 |
# Intent Parser: Qwen2.5-7B-Instruct (GGUF via llama-cpp-python)
|
| 27 |
-
# Using
|
| 28 |
-
#
|
| 29 |
-
QWEN_GGUF_PATH = MODELS_DIR / "qwen2.5-7b-instruct-
|
| 30 |
-
QWEN_N_GPU_LAYERS =
|
| 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
|