Xenobd commited on
Commit
20e7beb
·
verified ·
1 Parent(s): 362915a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -16
Dockerfile CHANGED
@@ -1,5 +1,7 @@
 
1
  FROM python:3.10-slim
2
 
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV VENV_PATH=/BitNet/venv
5
  ENV PATH="$VENV_PATH/bin:$PATH"
@@ -12,36 +14,41 @@ RUN apt-get update && apt-get install -y \
12
  cmake \
13
  build-essential \
14
  clang \
15
- ca-certificates \
16
- && rm -rf /var/lib/apt/lists/*
17
- RUN apt-get update && apt-get install -y \
18
- wget curl git cmake build-essential clang libssl-dev libtinfo-dev \
19
  ca-certificates \
20
  && rm -rf /var/lib/apt/lists/*
21
 
22
- # Clone BitNet
23
- RUN git clone --recursive https://github.com/microsoft/BitNet.git
24
 
25
- # Copy local files
26
- COPY . /BitNet
27
  WORKDIR /BitNet
28
 
29
- # Create virtual environment
 
 
 
30
  RUN python -m venv $VENV_PATH
31
 
32
- # Upgrade pip and install dependencies inside venv
33
  RUN pip install --upgrade pip
34
  RUN pip install -r requirements.txt
35
  RUN pip install huggingface_hub
36
 
 
 
 
37
 
38
- # Download model
39
- RUN huggingface-cli download HF1BitLLM/Llama3-8B-1.58-100B-tokens --local-dir models/Llama3-8B-1.58-100B-tokens
 
40
 
41
- # Setup environment / quantization
42
- RUN python -m setup_env -md models/Llama3-8B-1.58-100B-tokens -q i2_s
43
 
44
- RUN cd ./models/Llama3-8B-1.58-100B-tokens
45
- RUN ls
 
46
  # Default command
47
  CMD ["python", "app.py"]
 
1
+ # Base image
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"
 
14
  cmake \
15
  build-essential \
16
  clang \
17
+ libssl-dev \
18
+ libtinfo-dev \
 
 
19
  ca-certificates \
20
  && rm -rf /var/lib/apt/lists/*
21
 
22
+ # Clone BitNet repository
23
+ RUN git clone --recursive https://github.com/microsoft/BitNet.git /BitNet
24
 
25
+ # Set working directory
 
26
  WORKDIR /BitNet
27
 
28
+ # Copy local files (optional, if needed)
29
+ COPY . /BitNet
30
+
31
+ # Create Python virtual environment
32
  RUN python -m venv $VENV_PATH
33
 
34
+ # Upgrade pip and install Python dependencies
35
  RUN pip install --upgrade pip
36
  RUN pip install -r requirements.txt
37
  RUN pip install huggingface_hub
38
 
39
+ # Download model from Hugging Face
40
+ RUN huggingface-cli download HF1BitLLM/Llama3-8B-1.58-100B-tokens \
41
+ --local-dir models/Llama3-8B-1.58-100B-tokens
42
 
43
+ # Setup environment / quantization in one go
44
+ WORKDIR /BitNet/models/Llama3-8B-1.58-100B-tokens
45
+ RUN python -m setup_env -md . -q i2_s
46
 
47
+ # Optional: list files to confirm
48
+ RUN ls -lah
49
 
50
+ # Reset working directory for app
51
+ WORKDIR /BitNet
52
+ RUN pwd
53
  # Default command
54
  CMD ["python", "app.py"]