Spaces:
Sleeping
Sleeping
Add Spaces deployment requirements without PyAudio and remove PortAudio from Docker build
Browse files- Dockerfile +2 -2
- requirements-spaces.txt +33 -0
Dockerfile
CHANGED
|
@@ -3,10 +3,10 @@ FROM python:3.11-slim
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# System dependencies (CPU-only, no CUDA)
|
|
|
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
pkg-config \
|
| 8 |
libsndfile1 \
|
| 9 |
-
portaudio19-dev \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
# Copy project files
|
|
@@ -16,7 +16,7 @@ COPY . /app/
|
|
| 16 |
ENV PIP_NO_BUILD_ISOLATION=1
|
| 17 |
ENV PIP_DEFAULT_TIMEOUT=100
|
| 18 |
RUN pip install --upgrade pip setuptools wheel
|
| 19 |
-
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
| 20 |
|
| 21 |
EXPOSE 7860
|
| 22 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# System dependencies (CPU-only, no CUDA)
|
| 6 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
pkg-config \
|
| 9 |
libsndfile1 \
|
|
|
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
# Copy project files
|
|
|
|
| 16 |
ENV PIP_NO_BUILD_ISOLATION=1
|
| 17 |
ENV PIP_DEFAULT_TIMEOUT=100
|
| 18 |
RUN pip install --upgrade pip setuptools wheel
|
| 19 |
+
RUN pip install --no-cache-dir --prefer-binary -r requirements-spaces.txt
|
| 20 |
|
| 21 |
EXPOSE 7860
|
| 22 |
|
requirements-spaces.txt
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Core ML / inference
|
| 2 |
+
torch>=2.4.0
|
| 3 |
+
torchaudio>=2.4.0
|
| 4 |
+
transformers>=4.56,<5.3,!=5.0.*,!=5.1.* # MoonshineForConditionalGeneration support
|
| 5 |
+
accelerate>=0.30.0
|
| 6 |
+
bitsandbytes>=0.43.0 # 4-bit quant for MiniCPM on CPU
|
| 7 |
+
sentencepiece
|
| 8 |
+
protobuf
|
| 9 |
+
|
| 10 |
+
# ASR audio helpers
|
| 11 |
+
soundfile
|
| 12 |
+
librosa
|
| 13 |
+
huggingface_hub
|
| 14 |
+
|
| 15 |
+
# Qwen2.5 intent parser (llama-cpp-python with CUDA offload)
|
| 16 |
+
# Install with CUDA support; do not use the plain pip version.
|
| 17 |
+
# Run this separately after pip install -r requirements.txt:
|
| 18 |
+
# CMAKE_ARGS="-DGGML_CUDA=on" pip install llama-cpp-python --no-cache-dir
|
| 19 |
+
# Windows (MSVC):
|
| 20 |
+
# set CMAKE_ARGS=-DGGML_CUDA=on && pip install llama-cpp-python --no-cache-dir
|
| 21 |
+
llama-cpp-python>=0.2.85 # plain CPU fallback; override with CUDA build above
|
| 22 |
+
|
| 23 |
+
# VAD
|
| 24 |
+
numpy>=1.24.0 # Install early to avoid dependency conflicts
|
| 25 |
+
silero-vad # pulls torch; also needs torchaudio for audio I/O
|
| 26 |
+
onnxruntime>=1.16.0 # ONNX runtime for Silero VAD
|
| 27 |
+
|
| 28 |
+
# Gradio UI
|
| 29 |
+
gradio>=4.40.0
|
| 30 |
+
|
| 31 |
+
# Utilities
|
| 32 |
+
python-dotenv # optional: load HF_TOKEN from .env file
|
| 33 |
+
pydantic>=2.0 # JSON schema validation for Qwen output
|