Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +23 -9
Dockerfile
CHANGED
@@ -1,29 +1,43 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
-
WORKDIR /
|
4 |
|
5 |
# Install system dependencies
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
git \
|
|
|
|
|
|
|
8 |
build-essential \
|
|
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
-
#
|
|
|
|
|
|
|
|
|
12 |
COPY requirements.txt .
|
13 |
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
|
15 |
-
# Copy application code
|
16 |
-
COPY . .
|
17 |
-
|
18 |
# Clone and install IndicTransToolkit
|
19 |
RUN git clone https://github.com/VarunGumma/IndicTransToolkit \
|
20 |
&& cd IndicTransToolkit \
|
21 |
&& pip install --editable ./
|
22 |
|
23 |
-
#
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
-
# Expose
|
27 |
EXPOSE 7860
|
28 |
|
29 |
# Command to run the application
|
|
|
1 |
+
FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime
|
2 |
|
3 |
+
WORKDIR /code
|
4 |
|
5 |
# Install system dependencies
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
git \
|
8 |
+
wget \
|
9 |
+
ffmpeg \
|
10 |
+
libsndfile1 \
|
11 |
build-essential \
|
12 |
+
python3-dev \
|
13 |
&& rm -rf /var/lib/apt/lists/*
|
14 |
|
15 |
+
# Create cache directory with proper permissions
|
16 |
+
RUN mkdir -p /.cache/huggingface && chmod -R 777 /.cache
|
17 |
+
|
18 |
+
# Clean pip cache and install dependencies
|
19 |
+
RUN pip cache purge
|
20 |
COPY requirements.txt .
|
21 |
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
|
|
|
|
|
|
23 |
# Clone and install IndicTransToolkit
|
24 |
RUN git clone https://github.com/VarunGumma/IndicTransToolkit \
|
25 |
&& cd IndicTransToolkit \
|
26 |
&& pip install --editable ./
|
27 |
|
28 |
+
# Copy application code
|
29 |
+
COPY . .
|
30 |
+
|
31 |
+
# Create directories and set permissions
|
32 |
+
RUN mkdir -p templates static/audio \
|
33 |
+
&& chmod -R 777 static/audio
|
34 |
+
|
35 |
+
# Set environment variables
|
36 |
+
ENV PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:32
|
37 |
+
ENV TRANSFORMERS_CACHE=/.cache/huggingface/hub
|
38 |
+
ENV HF_HOME=/.cache/huggingface
|
39 |
|
40 |
+
# Expose port
|
41 |
EXPOSE 7860
|
42 |
|
43 |
# Command to run the application
|