Spaces:
Runtime error
Runtime error
File size: 1,334 Bytes
c94624b 14964a5 4e5a345 c94624b 4e5a345 402a24a 4e5a345 14964a5 c94624b 4e5a345 c175f6f 5a8f5b2 4e5a345 c94624b 4e5a345 |
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 45 46 47 |
FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
SHELL ["/bin/bash", "-c"]
# Environment variables for Hugging Face cache
ENV HF_HOME=/app/hf_cache
ENV TRANSFORMERS_CACHE=/app/hf_cache
ENV HF_TOKEN=${HF_TOKEN}
ENV PATH=/opt/conda/bin:$PATH
# Install system dependencies
RUN apt-get update && apt-get install -y \
git wget curl unzip ffmpeg libgl1-mesa-glx libglib2.0-0 && \
apt-get clean
# Set up working directory as /app
WORKDIR /app
# Copy project into /app
COPY . /app
# Fix permissions for all subdirectories
RUN mkdir -p /app/pretrained /app/hf_cache /.cache/gdown && \
chmod -R 777 /app && \
chmod -R 777 /.cache && \
chmod -R 777 /root
# Create conda environment and install dependencies
COPY requirements.txt /app/requirements.txt
RUN conda create -n realcam python=3.10 -y && \
conda run -n realcam pip install --upgrade pip && \
conda run -n realcam conda install ffmpeg=7 -c conda-forge && \
conda install pytorch==2.6 torchvision -c pytorch -c nvidia
conda run -n realcam pip install -r /app/requirements.txt
RUN chmod -R 777 /app /workspace
# # List contents (for debug)
RUN ls -la /app
RUN pip install gradio
# Expose Gradio default port
EXPOSE 7860
# Start the Gradio app
CMD ["conda", "run", "--no-capture-output", "-n", "realcam", "python", "finetune/gradio_app.py"]
|