Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +5 -4
Dockerfile
CHANGED
|
@@ -25,10 +25,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 25 |
# Set up working directory
|
| 26 |
WORKDIR /app
|
| 27 |
|
| 28 |
-
# Clone BitNet with submodules
|
| 29 |
RUN git clone --recursive https://github.com/microsoft/BitNet.git . && \
|
| 30 |
git checkout 404980eecae38affa4871c3e419eae3f44536a95 && \
|
| 31 |
-
git submodule update --init --recursive
|
|
|
|
| 32 |
|
| 33 |
# Install CPU-optimized PyTorch first (saves ~3GB of disk and download time)
|
| 34 |
RUN pip install --no-cache-dir torch torchaudio --index-url https://download.pytorch.org/whl/cpu
|
|
@@ -43,8 +44,8 @@ RUN python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(rep
|
|
| 43 |
# Pre-download Whisper model so the Space boots instantly without downloading at runtime
|
| 44 |
RUN python3 -c "from transformers import pipeline; pipeline('automatic-speech-recognition', model='openai/whisper-base', device=-1)"
|
| 45 |
|
| 46 |
-
# Compile the
|
| 47 |
-
RUN python3 setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s
|
| 48 |
|
| 49 |
# Copy your local app code into the container
|
| 50 |
COPY app.py .
|
|
|
|
| 25 |
# Set up working directory
|
| 26 |
WORKDIR /app
|
| 27 |
|
| 28 |
+
# Clone BitNet with submodules, checkout stable June 2025 commit, and patch the Clang const bug
|
| 29 |
RUN git clone --recursive https://github.com/microsoft/BitNet.git . && \
|
| 30 |
git checkout 404980eecae38affa4871c3e419eae3f44536a95 && \
|
| 31 |
+
git submodule update --init --recursive && \
|
| 32 |
+
sed -i 's/int8_t \* y_col = y/const int8_t * y_col = y/' src/ggml-bitnet-mad.cpp
|
| 33 |
|
| 34 |
# Install CPU-optimized PyTorch first (saves ~3GB of disk and download time)
|
| 35 |
RUN pip install --no-cache-dir torch torchaudio --index-url https://download.pytorch.org/whl/cpu
|
|
|
|
| 44 |
# Pre-download Whisper model so the Space boots instantly without downloading at runtime
|
| 45 |
RUN python3 -c "from transformers import pipeline; pipeline('automatic-speech-recognition', model='openai/whisper-base', device=-1)"
|
| 46 |
|
| 47 |
+
# Compile the BitNet kernels (bypass the redundant conversion script crash once binaries exist)
|
| 48 |
+
RUN python3 setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s || test -f build/bin/llama-cli
|
| 49 |
|
| 50 |
# Copy your local app code into the container
|
| 51 |
COPY app.py .
|