Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +20 -16
Dockerfile
CHANGED
|
@@ -1,21 +1,25 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM openeuler/vllm-cpu:
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
# RUN yum install -y some-package
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
#
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
#
|
| 17 |
-
# ENV HUGGING_FACE_HUB_TOKEN="<YOUR_HUGGINGFACE_TOKEN>"
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
#
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the openeuler/vllm-cpu base (includes Python, pip, and vLLM pre-installed)
|
| 2 |
+
FROM openeuler/vllm-cpu:0.8.5-oe2403lts
|
| 3 |
|
| 4 |
+
# Ensure Python uses the CPU device (vLLM expects VLLM_TARGET_DEVICE for inference)
|
| 5 |
+
ENV VLLM_TARGET_DEVICE=cpu
|
| 6 |
+
ENV PYTHONUNBUFFERED=1
|
| 7 |
|
| 8 |
+
# Set working directory
|
| 9 |
+
WORKDIR /workspace
|
|
|
|
| 10 |
|
| 11 |
+
# Upgrade pip and install CPU-only PyTorch, Transformers, Accelerate, Unsloth, etc.
|
| 12 |
+
# Use the official PyTorch CPU wheel index for performance on CPU:contentReference[oaicite:5]{index=5}.
|
| 13 |
+
RUN pip3 install --upgrade pip \
|
| 14 |
+
&& pip3 install torch --index-url https://download.pytorch.org/whl/cpu \
|
| 15 |
+
&& pip3 install transformers accelerate unsloth
|
| 16 |
|
| 17 |
+
# (Optional) Install unsloth_zoo or other utilities if needed:
|
| 18 |
+
# RUN pip3 install unsloth-zoo
|
|
|
|
| 19 |
|
| 20 |
+
# Copy an example inference script into the container
|
| 21 |
+
# (This script should load the model and do a sample generation.)
|
| 22 |
+
COPY inference.py /workspace/inference.py
|
| 23 |
+
|
| 24 |
+
# Default command: run the inference script to verify setup
|
| 25 |
+
CMD ["python3", "/workspace/inference.py"]
|