Spaces:
Runtime error
Runtime error
Initial test commit #2
Browse files- Dockerfile +9 -10
- requirements.txt +2 -7
Dockerfile
CHANGED
|
@@ -2,7 +2,7 @@ FROM python:3.10
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
libffi-dev \
|
| 8 |
libsndfile1 \
|
|
@@ -10,21 +10,20 @@ RUN apt-get update && apt-get install -y \
|
|
| 10 |
libxt6 \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# Copy requirements
|
| 14 |
COPY requirements.txt .
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
RUN pip install --no-cache-dir \
|
| 21 |
-
-r requirements.txt \
|
| 22 |
-
-f https://download.pytorch.org/whl/cpu/torch_stable.html
|
| 23 |
-
|
| 24 |
-
# Copy app code
|
| 25 |
COPY . .
|
| 26 |
|
| 27 |
EXPOSE 7860
|
|
|
|
| 28 |
ENV PYTHONUNBUFFERED=1
|
| 29 |
|
|
|
|
| 30 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
libffi-dev \
|
| 8 |
libsndfile1 \
|
|
|
|
| 10 |
libxt6 \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# Copy requirements first to leverage Docker cache
|
| 14 |
COPY requirements.txt .
|
| 15 |
|
| 16 |
+
# Install PyTorch and torchaudio first (CPU version)
|
| 17 |
+
# Install the rest of requirements
|
| 18 |
+
RUN pip install --no-cache-dir -r requirements.txt \
|
| 19 |
+
&& pip install --no-cache-dir torch==2.5.1 torchvision==0.20.1 torchaudio --index-url https://download.pytorch.org/whl/cu121
|
| 20 |
|
| 21 |
+
# Copy application files
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
COPY . .
|
| 23 |
|
| 24 |
EXPOSE 7860
|
| 25 |
+
|
| 26 |
ENV PYTHONUNBUFFERED=1
|
| 27 |
|
| 28 |
+
# Run the application
|
| 29 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
requirements.txt
CHANGED
|
@@ -2,13 +2,8 @@
|
|
| 2 |
numpy>=1.24.0,<2.0.0
|
| 3 |
librosa>=0.10.0
|
| 4 |
transformers>=4.38.0,<5.0
|
| 5 |
-
typing-extensions>=4.10.0
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
torch==2.6.0+cpu
|
| 9 |
-
torchaudio==2.6.0+cpu
|
| 10 |
-
|
| 11 |
-
# Audio processing
|
| 12 |
soundfile>=0.12.1
|
| 13 |
scipy>=1.11.0
|
| 14 |
praat-parselmouth>=0.4.3
|
|
@@ -24,4 +19,4 @@ python-multipart>=0.0.18
|
|
| 24 |
python-json-logger>=2.0.0
|
| 25 |
|
| 26 |
# Web UI
|
| 27 |
-
gradio==6.1.0
|
|
|
|
| 2 |
numpy>=1.24.0,<2.0.0
|
| 3 |
librosa>=0.10.0
|
| 4 |
transformers>=4.38.0,<5.0
|
|
|
|
| 5 |
|
| 6 |
+
# Audio
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
soundfile>=0.12.1
|
| 8 |
scipy>=1.11.0
|
| 9 |
praat-parselmouth>=0.4.3
|
|
|
|
| 19 |
python-json-logger>=2.0.0
|
| 20 |
|
| 21 |
# Web UI
|
| 22 |
+
gradio==6.1.0
|