Spaces:
Sleeping
Sleeping
Bouaziz-bad
commited on
Commit
·
b386b22
1
Parent(s):
3968f31
Introduce Dockerfile
Browse files- Dockerfile +33 -19
- requirements.txt +3 -21
Dockerfile
CHANGED
@@ -7,30 +7,44 @@ FROM docker.io/library/python:3.11-slim
|
|
7 |
# Install system dependencies, including build tools and ffmpeg
|
8 |
RUN apt-get update && apt-get install -y sox ffmpeg build-essential
|
9 |
|
10 |
-
#
|
11 |
-
|
12 |
-
WORKDIR /home/appuser
|
13 |
|
14 |
-
#
|
15 |
-
|
16 |
|
17 |
-
# Install
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
-
#
|
21 |
-
|
22 |
|
23 |
-
#
|
24 |
-
|
25 |
|
26 |
-
#
|
27 |
-
|
|
|
|
|
|
|
28 |
|
29 |
-
#
|
30 |
-
|
31 |
|
32 |
-
#
|
33 |
-
|
34 |
|
35 |
-
#
|
36 |
-
CMD ["
|
|
|
7 |
# Install system dependencies, including build tools and ffmpeg
|
8 |
RUN apt-get update && apt-get install -y sox ffmpeg build-essential
|
9 |
|
10 |
+
# Use Python 3.10 (best compatibility with NeMo 1.20.0)
|
11 |
+
FROM python:3.10-slim
|
|
|
12 |
|
13 |
+
# Set working directory
|
14 |
+
WORKDIR /app
|
15 |
|
16 |
+
# Install system dependencies
|
17 |
+
# build-essential for compiling youtokentome, ffmpeg/libsndfile for audio
|
18 |
+
RUN apt-get update && apt-get install -y \
|
19 |
+
build-essential \
|
20 |
+
ffmpeg \
|
21 |
+
libsndfile1 \
|
22 |
+
sox \
|
23 |
+
&& rm -rf /var/lib/apt/lists/*
|
24 |
+
|
25 |
+
# Copy requirements first
|
26 |
+
COPY requirements.txt .
|
27 |
+
|
28 |
+
# Install Cython FIRST (critical for youtokentome)
|
29 |
+
RUN pip install --no-cache-dir Cython
|
30 |
|
31 |
+
# Install torch before NeMo
|
32 |
+
RUN pip install --no-cache-dir torch==1.13.1 torchaudio==0.13.1
|
33 |
|
34 |
+
# Install pytorch-lightning with compatible version
|
35 |
+
RUN pip install --no-cache-dir "pytorch-lightning==1.9.4"
|
36 |
|
37 |
+
# Install youtokentome (now it can build with Cython)
|
38 |
+
RUN pip install --no-cache-dir youtokentome
|
39 |
+
|
40 |
+
# Install remaining requirements
|
41 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
42 |
|
43 |
+
# Copy app files
|
44 |
+
COPY backend.py app.py ./
|
45 |
|
46 |
+
# Expose port (HFS expects 7860 for Gradio)
|
47 |
+
EXPOSE 7860
|
48 |
|
49 |
+
# Run Gradio app
|
50 |
+
CMD ["python", "app.py"]
|
requirements.txt
CHANGED
@@ -1,23 +1,5 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
# Core PyTorch
|
5 |
-
torch==1.13.1
|
6 |
-
torchaudio==0.13.1
|
7 |
-
|
8 |
-
# Compatible PyTorch Lightning
|
9 |
-
pytorch-lightning==1.9.4
|
10 |
-
|
11 |
-
# Other required
|
12 |
omegaconf>=2.0
|
13 |
hydra-core
|
14 |
-
|
15 |
-
gradio==4.25.0
|
16 |
-
|
17 |
-
# Install youtokentome via pre-built wheel (avoid source build)
|
18 |
-
--find-links https://download.pytorch.org/whl/torch_stable.html
|
19 |
-
--prefer-binary
|
20 |
-
youtokentome
|
21 |
-
|
22 |
-
# Finally, install NeMo
|
23 |
-
git+https://github.com/NVIDIA/[email protected]#egg=nemo_toolkit[asr]&subdirectory=.
|
|
|
1 |
+
gradio==4.25.0
|
2 |
+
numpy<1.24.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
omegaconf>=2.0
|
4 |
hydra-core
|
5 |
+
nemo_toolkit[asr]>=1.20.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|