fnmodel / Dockerfile
aeb56
Initial commit: LoRA model merger
a951334
raw
history blame
969 Bytes
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV CUDA_HOME=/usr/local/cuda
ENV PATH="${CUDA_HOME}/bin:${PATH}"
ENV LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.10 \
python3-pip \
git \
git-lfs \
wget \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip
RUN pip3 install --upgrade pip
# Set working directory
WORKDIR /app
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy application files
COPY . .
# Create directories for models
RUN mkdir -p /app/models /app/merged_model
# Expose port for Gradio
EXPOSE 7860
# Set HuggingFace cache directory
ENV HF_HOME=/app/cache
ENV TRANSFORMERS_CACHE=/app/cache
# Run the application
CMD ["python3", "app.py"]