llama-omni / Dockerfile
marcosremar2's picture
ereerre
c57019c
raw
history blame
1.26 kB
FROM python:3.10-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
wget \
git \
ffmpeg \
libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install PyTorch first
RUN pip install --no-cache-dir torch>=2.0.0
# Then install other dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Create necessary directories
RUN mkdir -p models/speech_encoder vocoder
# Download vocoder models if needed
RUN wget -P vocoder/ https://dl.fbaipublicfiles.com/fairseq/speech_to_speech/vocoder/code_hifigan/mhubert_vp_en_es_fr_it3_400k_layer11_km1000_lj/g_00500000 \
&& wget -P vocoder/ https://dl.fbaipublicfiles.com/fairseq/speech_to_speech/vocoder/code_hifigan/mhubert_vp_en_es_fr_it3_400k_layer11_km1000_lj/config.json
# Copy the application code
COPY . .
# Optional: Install flash-attn on compatible systems only
RUN if [ "$(uname -m)" != "aarch64" ]; then \
pip install --no-cache-dir flash-attn || echo "Failed to install flash-attn, continuing without it"; \
fi
# Expose port for the application
EXPOSE 7860
# Command to run the application
CMD ["python", "app_gradio_spaces.py"]