LevArtesa commited on
Commit
2bd1293
·
verified ·
1 Parent(s): df66888

clone Dockerfile from LevArtesa/grpo-humanizer-training

Browse files
Files changed (1) hide show
  1. Dockerfile +39 -0
Dockerfile ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel
2
+
3
+ # Create user for HF Spaces (runs as uid 1000)
4
+ RUN useradd -m -u 1000 user || true
5
+ ENV HOME=/home/user
6
+ ENV PATH=/home/user/.local/bin:$PATH
7
+
8
+ # Set working directory
9
+ WORKDIR /app
10
+
11
+ # Copy requirements and install
12
+ # requirements.txt already pins python-docx>=1.1 and hypothesis>=6.100
13
+ # which are required by Dataset v2 tooling (document_cutter, PBT tests).
14
+ COPY requirements.txt .
15
+ RUN pip install --no-cache-dir --upgrade pip && \
16
+ pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Copy all files (training/* plus scripts/* when the build context is the
19
+ # repo root). entrypoint.sh lands at /app/entrypoint.sh.
20
+ COPY . .
21
+
22
+ # Make the dispatch entrypoint executable. The script selects between
23
+ # serve / train / train_v2 / filter_dataset_v2 / evaluate based on the
24
+ # ENTRYPOINT_MODE environment variable (see training/entrypoint.sh for
25
+ # details). Default is "serve" to preserve the existing HF Space
26
+ # inference behaviour.
27
+ RUN chmod +x /app/entrypoint.sh
28
+
29
+ # Fix permissions
30
+ RUN chown -R 1000:1000 /app /home/user
31
+ USER 1000
32
+
33
+ # Set cache dirs to writable locations
34
+ ENV HF_HOME=/home/user/.cache/huggingface
35
+ ENV TORCH_HOME=/home/user/.cache/torch
36
+
37
+ # Default to the inference server. Override by setting
38
+ # ENTRYPOINT_MODE=train_v2 (or another supported value) on the HF Space.
39
+ CMD ["/app/entrypoint.sh"]