Spaces:
Sleeping
Sleeping
| FROM nvidia/cuda:12.1-devel-ubuntu22.04 | |
| # Install Python 3.10 | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3.10 python3.10-dev python3-pip python3.10-venv \ | |
| git gcc g++ libglib2.0-0 libsm6 libxext6 libxrender-dev \ | |
| build-essential curl && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Create symbolic links for python | |
| RUN ln -s /usr/bin/python3.10 /usr/bin/python && \ | |
| ln -s /usr/bin/python3.10 /usr/bin/python3 | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # Install dependencies step by step untuk menghindari konflik | |
| RUN pip install --upgrade pip && \ | |
| pip install --no-cache-dir packaging ninja wheel setuptools numpy | |
| # Install PyTorch dengan CUDA support | |
| RUN pip install --no-cache-dir torch==2.2.2 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 | |
| # Install dependencies lain sebelum GUI-Actor | |
| RUN pip install --no-cache-dir \ | |
| transformers \ | |
| datasets \ | |
| Pillow \ | |
| accelerate \ | |
| scipy \ | |
| qwen-vl-utils \ | |
| fastapi \ | |
| "uvicorn[standard]" | |
| # Install GUI-Actor package terakhir (includes flash-attn) | |
| RUN pip install --no-cache-dir "git+https://github.com/microsoft/GUI-Actor.git" | |
| COPY --chown=user . . | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |