Create Dockerfile
Browse files- Dockerfile +46 -0
Dockerfile
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ubuntu:22.04
|
2 |
+
|
3 |
+
# Set environment variables to avoid some prompts
|
4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
5 |
+
|
6 |
+
# Update & install system dependencies
|
7 |
+
RUN apt-get update && apt-get install -y \
|
8 |
+
wget \
|
9 |
+
curl \
|
10 |
+
git \
|
11 |
+
cmake \
|
12 |
+
build-essential \
|
13 |
+
python3 \
|
14 |
+
python3-pip \
|
15 |
+
python-is-python3 \
|
16 |
+
ca-certificates \
|
17 |
+
&& rm -rf /var/lib/apt/lists/*
|
18 |
+
|
19 |
+
# Install LLVM
|
20 |
+
RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
|
21 |
+
|
22 |
+
# Clone the BitNet repository
|
23 |
+
RUN git clone --recursive https://github.com/microsoft/BitNet.git
|
24 |
+
|
25 |
+
WORKDIR /BitNet
|
26 |
+
|
27 |
+
# Install Python dependencies
|
28 |
+
RUN pip install --upgrade pip && \
|
29 |
+
pip install -r requirements.txt
|
30 |
+
|
31 |
+
# Hugging Face CLI setup
|
32 |
+
RUN pip install huggingface_hub
|
33 |
+
|
34 |
+
# Optional: Pass HF_TOKEN as build-arg or mount config manually
|
35 |
+
# If model requires authentication, make sure to set HF_TOKEN in build
|
36 |
+
ARG HF_TOKEN
|
37 |
+
RUN huggingface-cli login --token $HF_TOKEN || true
|
38 |
+
|
39 |
+
# Download model into models/ folder
|
40 |
+
RUN huggingface-cli download tiiuae/Falcon3-7B-Instruct-1.58bit-GGUF --local-dir models/
|
41 |
+
|
42 |
+
# Run cmake build process (assumes a CMakeLists.txt is in place)
|
43 |
+
RUN mkdir -p build && cd build && cmake .. && make -j$(nproc)
|
44 |
+
|
45 |
+
# Set default command
|
46 |
+
CMD ["python", "app.py"]
|