Xenobd commited on
Commit
6b9ca89
·
verified ·
1 Parent(s): ef5f5c5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -11
Dockerfile CHANGED
@@ -1,8 +1,10 @@
1
  FROM debian:12-slim
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 \
@@ -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 everything from the local directory (where Dockerfile is) into the BitNet directory in the container
23
  COPY . /BitNet
24
-
25
  WORKDIR /BitNet
26
 
27
- # Install Python dependencies
28
- RUN pip install -r ./requirements.txt
29
 
30
- # Hugging Face CLI setup
31
- RUN pip install huggingface_hub
 
 
32
 
33
- # Optional: HF token
34
  ARG HF_TOKEN
35
  RUN huggingface-cli login --token $HF_TOKEN || true
36
 
37
- RUN huggingface-cli download HF1BitLLM/Llama3-8B-1.58-100B-tokens --local-dir models/Llama3-8B-1.58-100B-tokens
38
- RUN python setup_env.py -md models/Llama3-8B-1.58-100B-tokens -q i2_s
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"]