Spaces:
Runtime error
Runtime error
Commit ·
1c1d77b
1
Parent(s): 9e54e20
Fix HF Space crashing: Copy missing training directory and fix user 1000 permissions
Browse files- Dockerfile +5 -1
Dockerfile
CHANGED
|
@@ -16,13 +16,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 16 |
COPY requirements.txt .
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
-
# Copy the salespath_env package
|
| 20 |
COPY salespath_env/ ./salespath_env/
|
|
|
|
| 21 |
|
| 22 |
# Copy and set permissions for the training script
|
| 23 |
COPY run_hf_training.sh ./run_hf_training.sh
|
| 24 |
RUN sed -i 's/\r$//' ./run_hf_training.sh && chmod +x ./run_hf_training.sh
|
| 25 |
|
|
|
|
|
|
|
|
|
|
| 26 |
# Health check
|
| 27 |
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
| 28 |
CMD curl -f http://localhost:${PORT}/health || exit 1
|
|
|
|
| 16 |
COPY requirements.txt .
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
+
# Copy the salespath_env package and training scripts
|
| 20 |
COPY salespath_env/ ./salespath_env/
|
| 21 |
+
COPY training/ ./training/
|
| 22 |
|
| 23 |
# Copy and set permissions for the training script
|
| 24 |
COPY run_hf_training.sh ./run_hf_training.sh
|
| 25 |
RUN sed -i 's/\r$//' ./run_hf_training.sh && chmod +x ./run_hf_training.sh
|
| 26 |
|
| 27 |
+
# Grant full read/write access so Hugging Face user 1000 can write model checkpoints
|
| 28 |
+
RUN chmod -R 777 /app
|
| 29 |
+
|
| 30 |
# Health check
|
| 31 |
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
| 32 |
CMD curl -f http://localhost:${PORT}/health || exit 1
|