Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +26 -38
Dockerfile
CHANGED
@@ -1,60 +1,48 @@
|
|
1 |
-
|
2 |
-
FROM python:3.10-slim
|
3 |
|
4 |
-
# Non-interactive environment
|
5 |
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
-
ENV VENV_PATH=/BitNet/venv
|
7 |
-
ENV PATH="$VENV_PATH/bin:$PATH"
|
8 |
|
9 |
-
#
|
10 |
RUN apt-get update && apt-get install -y \
|
11 |
wget \
|
12 |
curl \
|
13 |
git \
|
14 |
cmake \
|
15 |
build-essential \
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
ca-certificates \
|
20 |
&& rm -rf /var/lib/apt/lists/*
|
21 |
|
22 |
-
#
|
23 |
-
|
|
|
24 |
|
25 |
-
#
|
26 |
-
|
27 |
|
28 |
-
# Copy local
|
29 |
COPY . /BitNet
|
30 |
|
31 |
-
|
32 |
-
RUN python -m venv $VENV_PATH
|
33 |
-
|
34 |
-
# Upgrade pip and install dependencies
|
35 |
-
RUN pip install --upgrade pip
|
36 |
-
RUN pip install -r requirements.txt
|
37 |
-
RUN pip install huggingface_hub
|
38 |
|
39 |
-
#
|
40 |
-
RUN
|
41 |
-
|
42 |
|
43 |
-
#
|
44 |
-
RUN
|
45 |
|
46 |
-
#
|
47 |
-
|
48 |
-
RUN
|
49 |
|
50 |
-
#
|
51 |
-
|
52 |
|
53 |
-
#
|
54 |
-
|
|
|
55 |
|
56 |
-
|
57 |
-
CMD ["python", "run_inference_server.py", \
|
58 |
-
"-m", "./models/Llama3-8B-1.58-100B-tokens/ggml-model-i2_s.gguf", \
|
59 |
-
"--host", "0.0.0.0", \
|
60 |
-
"--port", "7860"]
|
|
|
1 |
+
FROM ubuntu:22.04
|
|
|
2 |
|
|
|
3 |
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
4 |
|
5 |
+
# Update & install system dependencies
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
wget \
|
8 |
curl \
|
9 |
git \
|
10 |
cmake \
|
11 |
build-essential \
|
12 |
+
python3 \
|
13 |
+
python3-pip \
|
14 |
+
python-is-python3 \
|
15 |
ca-certificates \
|
16 |
&& rm -rf /var/lib/apt/lists/*
|
17 |
|
18 |
+
# Install LLVM
|
19 |
+
# NOTE: Uncomment this if you actually want to install LLVM.
|
20 |
+
# RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
|
21 |
|
22 |
+
# Clone BitNet
|
23 |
+
RUN git clone --recursive https://github.com/microsoft/BitNet.git
|
24 |
|
25 |
+
# Copy everything from the local directory (where Dockerfile is) into the BitNet directory in the container
|
26 |
COPY . /BitNet
|
27 |
|
28 |
+
WORKDIR /BitNet
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
+
# Install Python dependencies
|
31 |
+
RUN pip install --upgrade pip && \
|
32 |
+
pip install -r requirements.txt
|
33 |
|
34 |
+
# Hugging Face CLI setup
|
35 |
+
RUN pip install huggingface_hub
|
36 |
|
37 |
+
# Optional: HF token
|
38 |
+
ARG HF_TOKEN
|
39 |
+
RUN huggingface-cli login --token $HF_TOKEN || true
|
40 |
|
41 |
+
# Download the model into ./models/
|
42 |
+
RUN huggingface-cli download israellaguan/Falcon3-10B-Instruct-1.58bit-i2_s --local-dir models/
|
43 |
|
44 |
+
# Run BitNet preprocessing script
|
45 |
+
RUN python utils/codegen_tl1.py --model bitnet_b1_58-3B --BM 160,320,320 --BK 64,128,64 --bm 32,64,32
|
46 |
+
RUN mkdir -p build && cd build && cmake .. && make -j$(nproc)
|
47 |
|
48 |
+
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|