File size: 1,068 Bytes
8389277
72a8f7d
8389277
72a8f7d
 
 
 
8389277
 
 
72a8f7d
8389277
72a8f7d
 
8389277
 
 
 
 
72a8f7d
 
 
 
 
 
 
 
8389277
 
 
 
 
 
 
 
 
 
 
72a8f7d
8389277
72a8f7d
 
 
 
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
39
40
41
42
43
44
FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime

WORKDIR /code

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    wget \
    ffmpeg \
    libsndfile1 \
    build-essential \
    python3-dev \
    && rm -rf /var/lib/apt/lists/*

# Create cache directory with proper permissions
RUN mkdir -p /.cache/huggingface && chmod -R 777 /.cache

# Clean pip cache and install dependencies
RUN pip cache purge
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Clone and install IndicTransToolkit
RUN git clone https://github.com/VarunGumma/IndicTransToolkit \
    && cd IndicTransToolkit \
    && pip install --editable ./

# Copy application code
COPY . .

# Create directories and set permissions
RUN mkdir -p templates static/audio \
    && chmod -R 777 static/audio

# Set environment variables
ENV PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:32
ENV TRANSFORMERS_CACHE=/.cache/huggingface/hub
ENV HF_HOME=/.cache/huggingface

# Expose port
EXPOSE 7860

# Command to run the application
CMD ["python", "app.py"]