forked from FunAudioLLM/SenseVoice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (28 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
38 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# ======================================================
# FunASR SenseVoiceSmall Inference Server
# ======================================================
FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
# Install system dependencies
RUN apt-get update && apt-get install -y \
ffmpeg libsndfile1 git && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN ls -la /app
# Copy only requirements first
COPY requirements.txt /app/
# Install dependencies (cached if requirements.txt didn't change)
RUN pip install --no-cache-dir -r requirements.txt
# Now copy the rest of your code
COPY . /app
# Optional: preload model weights during build (saves runtime download)
# RUN python -c "from funasr import AutoModel; AutoModel(model='iic/SenseVoiceSmall')"
# Expose FastAPI port
EXPOSE 50000
# Environment variables
ENV SENSEVOICE_DEVICE=auto
ENV PYTHONUNBUFFERED=1
ENV MODELSCOPE_CACHE=/models
# Create model cache directory (helps reuse between restarts)
RUN mkdir -p /models
# Start FastAPI app
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "50000"]