Spaces:
Running
Running
Download Dockerfile from RDS777/TARGET_SPACE: direct link, hf CLI and curl.
- Browser
- Download file 2.29 kB
-
https://huggingface.co/spaces/RDS777/TARGET_SPACE/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/RDS777/TARGET_SPACE/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/RDS777/TARGET_SPACE/resolve/main/Dockerfile
2.29 kB
| # Space Hugging Face (SDK docker) — un seul conteneur, un seul port : interface UNIQUE, API et 3D Symbioza, | |
| # pipeline d'agents et moteur GRPO/DPO. Aucune inférence en ligne : tout tourne sur le GPU du Space. | |
| # | |
| # Matériel visé : L4 24 Go (bf16, modèle 7B) ou T4 16 Go (fp16, modèle 1,5B). Le profil est choisi au | |
| # lancement par engine/trainer.py selon la VRAM réellement détectée ; aucune valeur n'est codée en dur ici. | |
| # Image plus légère pour un Space CPU : --build-arg TORCH_VARIANT=cpu (l'entraînement y est alors impossible, | |
| # le reste du Space fonctionne). | |
| FROM python:3.12-slim | |
| ARG TORCH_VARIANT=gpu | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| PORT=7860 \ | |
| MOUH_DATA_DIR=/home/user/data \ | |
| HOME=/home/user | |
| # Chaîne de compilation : Triton (noyaux de trl, SFT/GRPO/DPO) compile son module de pilotage CUDA au premier | |
| # appel (sans gcc : « Failed to find C compiler », v4.1.2) ; make sert aux extensions C de certaines | |
| # dépendances. L'image python:3.12-slim n'en contient aucun des deux. | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends gcc libc6-dev make \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Utilisateur non-root (exigé par les Spaces) : l'isolation du bac à sable repose sur ce conteneur. | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /home/user/app | |
| COPY --chown=user requirements.txt requirements-dev.txt ./ | |
| RUN if [ "$TORCH_VARIANT" = "cpu" ]; then \ | |
| pip install --index-url https://download.pytorch.org/whl/cpu torch ; \ | |
| else \ | |
| pip install "torch>=2.4,<2.16" ; \ | |
| fi \ | |
| && pip install -r requirements.txt | |
| # Tout le dépôt : mouh/ (noyau, JEV, bac à sable, géométrie), agents/ (pipeline et journal de travail), | |
| # engine/ (GRPO/DPO), jobs/ (entraînement continu), web/symbioza/ (3D servie sur /symbioza). | |
| COPY --chown=user . . | |
| USER user | |
| # Le dossier local (data/, failures/, adapter/, adapter_rl/, work_journal.jsonl) vit sur /data quand le Space | |
| # a un stockage persistant, sinon ici — le panneau de pilotage indique lequel est actif. | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=40s \ | |
| CMD python -c "import urllib.request,os;urllib.request.urlopen('http://127.0.0.1:'+os.environ.get('PORT','7860'))" || exit 1 | |
| CMD ["python", "app.py"] | |