Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +18 -11
Dockerfile
CHANGED
|
@@ -1,8 +1,10 @@
|
|
| 1 |
FROM debian:12-slim
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
#
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
wget \
|
| 8 |
curl \
|
|
@@ -19,25 +21,30 @@ RUN apt-get update && apt-get install -y \
|
|
| 19 |
# Clone BitNet
|
| 20 |
RUN git clone --recursive https://github.com/microsoft/BitNet.git
|
| 21 |
|
| 22 |
-
# Copy
|
| 23 |
COPY . /BitNet
|
| 24 |
-
|
| 25 |
WORKDIR /BitNet
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
RUN
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
RUN
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
# Optional:
|
| 34 |
ARG HF_TOKEN
|
| 35 |
RUN huggingface-cli login --token $HF_TOKEN || true
|
| 36 |
|
| 37 |
-
|
| 38 |
-
RUN
|
| 39 |
|
|
|
|
|
|
|
| 40 |
|
|
|
|
|
|
|
| 41 |
|
| 42 |
# Default command
|
| 43 |
-
CMD ["python3", "app.py"]
|
|
|
|
| 1 |
FROM debian:12-slim
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
ENV VENV_PATH=/BitNet/venv
|
| 5 |
+
ENV PATH="$VENV_PATH/bin:$PATH"
|
| 6 |
|
| 7 |
+
# Install system dependencies
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
wget \
|
| 10 |
curl \
|
|
|
|
| 21 |
# Clone BitNet
|
| 22 |
RUN git clone --recursive https://github.com/microsoft/BitNet.git
|
| 23 |
|
| 24 |
+
# Copy local files
|
| 25 |
COPY . /BitNet
|
|
|
|
| 26 |
WORKDIR /BitNet
|
| 27 |
|
| 28 |
+
# Create virtual environment
|
| 29 |
+
RUN python3 -m venv $VENV_PATH
|
| 30 |
|
| 31 |
+
# Upgrade pip and install dependencies inside venv
|
| 32 |
+
RUN python3 -m pip3 install --upgrade pip
|
| 33 |
+
RUN python3 -m pip3 install -r requirements.txt
|
| 34 |
+
RUN python3 -m pip3 install huggingface_hub
|
| 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 python3 -m huggingface_hub download HF1BitLLM/Llama3-8B-1.58-100B-tokens --local-dir models/Llama3-8B-1.58-100B-tokens
|
| 42 |
|
| 43 |
+
# Setup environment / quantization
|
| 44 |
+
RUN python3 -m setup_env -md models/Llama3-8B-1.58-100B-tokens -q i2_s
|
| 45 |
|
| 46 |
+
# Build C++ runtime
|
| 47 |
+
RUN mkdir -p build && cd build && cmake .. && make -j$(nproc)
|
| 48 |
|
| 49 |
# Default command
|
| 50 |
+
CMD ["python3", "app.py"]
|