File size: 1,261 Bytes
3adafca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
df163a2
3adafca
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM ubuntu:22.04

# Set environment variables to avoid some prompts
ENV DEBIAN_FRONTEND=noninteractive

# Update & install system dependencies
RUN apt-get update && apt-get install -y \
    wget \
    curl \
    git \
    cmake \
    build-essential \
    python3 \
    python3-pip \
    python-is-python3 \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Install LLVM
# Clone the BitNet repository
RUN git clone --recursive https://github.com/microsoft/BitNet.git

WORKDIR /BitNet

# Install Python dependencies
RUN pip install --upgrade pip && \
    pip install -r requirements.txt

# Hugging Face CLI setup
RUN pip install huggingface_hub

# Optional: Pass HF_TOKEN as build-arg or mount config manually
# If model requires authentication, make sure to set HF_TOKEN in build
ARG HF_TOKEN
RUN huggingface-cli login --token $HF_TOKEN || true

# Download model into models/ folder
RUN huggingface-cli download tiiuae/Falcon3-7B-Instruct-1.58bit-GGUF --local-dir models/
RUN python utils/codegen_tl1.py --model bitnet_b1_58-3B --BM 160,320,320 --BK 64,128,64 --bm 32,64,32

# Run cmake build process (assumes a CMakeLists.txt is in place)
RUN mkdir -p build && cd build && cmake .. && make -j$(nproc)

# Set default command
CMD ["python", "app.py"]