Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +40 -0
Dockerfile
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
|
| 2 |
+
|
| 3 |
+
# Install system dependencies
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
git \
|
| 6 |
+
python3.10 \
|
| 7 |
+
python3-pip \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# Set working directory
|
| 11 |
+
WORKDIR /app
|
| 12 |
+
|
| 13 |
+
# Install Python packages
|
| 14 |
+
COPY requirements.txt .
|
| 15 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 16 |
+
|
| 17 |
+
# Install custom FastChat version
|
| 18 |
+
RUN git clone -b self-lengthen https://github.com/quanshr/FastChat.git && \
|
| 19 |
+
cd FastChat && \
|
| 20 |
+
pip3 install -e ".[model_worker,webui]"
|
| 21 |
+
|
| 22 |
+
# Copy project files
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
# Set environment variables
|
| 26 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
| 27 |
+
ENV WORLD_SIZE=1
|
| 28 |
+
ENV RANK=0
|
| 29 |
+
ENV MASTER_ADDR=localhost
|
| 30 |
+
ENV MASTER_PORT=29500
|
| 31 |
+
|
| 32 |
+
# Create startup script
|
| 33 |
+
RUN echo '#!/bin/bash\n\
|
| 34 |
+
cd /app/qwen\n\
|
| 35 |
+
bash run.sh --base_model=$MODEL_PATH --instruct_count=$INSTRUCT_COUNT --max_iter=$MAX_ITER\n\
|
| 36 |
+
python collect_data.py' > /app/start.sh && \
|
| 37 |
+
chmod +x /app/start.sh
|
| 38 |
+
|
| 39 |
+
# Command to run
|
| 40 |
+
ENTRYPOINT ["/app/start.sh"]
|