Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -12
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
ENV VENV_PATH=/BitNet/venv
|
|
@@ -11,10 +11,6 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
git \
|
| 12 |
cmake \
|
| 13 |
build-essential \
|
| 14 |
-
python3 \
|
| 15 |
-
python3-pip \
|
| 16 |
-
python3-venv \
|
| 17 |
-
python-is-python3 \
|
| 18 |
ca-certificates \
|
| 19 |
&& rm -rf /var/lib/apt/lists/*
|
| 20 |
|
|
@@ -26,25 +22,25 @@ COPY . /BitNet
|
|
| 26 |
WORKDIR /BitNet
|
| 27 |
|
| 28 |
# Create virtual environment
|
| 29 |
-
RUN
|
| 30 |
|
| 31 |
# Upgrade pip and install dependencies inside venv
|
| 32 |
-
RUN
|
| 33 |
-
RUN
|
| 34 |
-
RUN
|
| 35 |
|
| 36 |
# Optional: Hugging Face token
|
| 37 |
ARG HF_TOKEN
|
| 38 |
RUN huggingface-cli login --token $HF_TOKEN || true
|
| 39 |
|
| 40 |
# Download model
|
| 41 |
-
RUN
|
| 42 |
|
| 43 |
# Setup environment / quantization
|
| 44 |
-
RUN
|
| 45 |
|
| 46 |
# Build C++ runtime
|
| 47 |
RUN mkdir -p build && cd build && cmake .. && make -j$(nproc)
|
| 48 |
|
| 49 |
# Default command
|
| 50 |
-
CMD ["
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
ENV VENV_PATH=/BitNet/venv
|
|
|
|
| 11 |
git \
|
| 12 |
cmake \
|
| 13 |
build-essential \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
ca-certificates \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
|
|
|
| 22 |
WORKDIR /BitNet
|
| 23 |
|
| 24 |
# Create virtual environment
|
| 25 |
+
RUN python -m venv $VENV_PATH
|
| 26 |
|
| 27 |
# Upgrade pip and install dependencies inside venv
|
| 28 |
+
RUN python -m pip install --upgrade pip
|
| 29 |
+
RUN python -m pip install -r requirements.txt
|
| 30 |
+
RUN python -m pip install huggingface_hub
|
| 31 |
|
| 32 |
# Optional: Hugging Face token
|
| 33 |
ARG HF_TOKEN
|
| 34 |
RUN huggingface-cli login --token $HF_TOKEN || true
|
| 35 |
|
| 36 |
# Download model
|
| 37 |
+
RUN python -m huggingface-cli download HF1BitLLM/Llama3-8B-1.58-100B-tokens --local-dir models/Llama3-8B-1.58-100B-tokens
|
| 38 |
|
| 39 |
# Setup environment / quantization
|
| 40 |
+
RUN python -m setup_env -md models/Llama3-8B-1.58-100B-tokens -q i2_s
|
| 41 |
|
| 42 |
# Build C++ runtime
|
| 43 |
RUN mkdir -p build && cd build && cmake .. && make -j$(nproc)
|
| 44 |
|
| 45 |
# Default command
|
| 46 |
+
CMD ["python", "app.py"]
|