Spaces:
Runtime error
Runtime error
Commit ·
9e54e20
1
Parent(s): c783ce8
Fix HF Space crashing: Resolve port mismatch, fix CRLF line endings, and force Python unbuffered output
Browse files- Dockerfile +1 -1
- run_hf_training.sh +4 -3
Dockerfile
CHANGED
|
@@ -21,7 +21,7 @@ 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 chmod +x ./run_hf_training.sh
|
| 25 |
|
| 26 |
# Health check
|
| 27 |
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
|
|
| 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 \
|
run_hf_training.sh
CHANGED
|
@@ -1,16 +1,17 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
# Start the environment server in the background
|
| 4 |
echo "Starting SalesPath environment server..."
|
| 5 |
-
uvicorn salespath_env.server.app:app --host 0.0.0.0 --port
|
| 6 |
|
| 7 |
# Give the server a few seconds to start up completely
|
| 8 |
sleep 5
|
| 9 |
|
| 10 |
# Start the GRPO Training using standard HuggingFace (PEFT)
|
| 11 |
echo "Starting 7B GRPO Training..."
|
| 12 |
-
PYTORCH_ALLOC_CONF=expandable_segments:True python -m training.grpo_train \
|
| 13 |
--mode grpo \
|
|
|
|
| 14 |
--model-name Qwen/Qwen2.5-7B-Instruct \
|
| 15 |
--grpo-steps 150 \
|
| 16 |
--grpo-dataset-size 128 \
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
# Start the environment server in the background (HF Spaces default port 7860)
|
| 4 |
echo "Starting SalesPath environment server..."
|
| 5 |
+
uvicorn salespath_env.server.app:app --host 0.0.0.0 --port 7860 &
|
| 6 |
|
| 7 |
# Give the server a few seconds to start up completely
|
| 8 |
sleep 5
|
| 9 |
|
| 10 |
# Start the GRPO Training using standard HuggingFace (PEFT)
|
| 11 |
echo "Starting 7B GRPO Training..."
|
| 12 |
+
PYTORCH_ALLOC_CONF=expandable_segments:True python -u -m training.grpo_train \
|
| 13 |
--mode grpo \
|
| 14 |
+
--env-url http://127.0.0.1:7860 \
|
| 15 |
--model-name Qwen/Qwen2.5-7B-Instruct \
|
| 16 |
--grpo-steps 150 \
|
| 17 |
--grpo-dataset-size 128 \
|