Spaces:
Build error
Build error
File size: 1,337 Bytes
9fadf46 a1c2725 9fadf46 a1c2725 b11641c a1c2725 b11641c a1c2725 b11641c a1c2725 b11641c 9fadf46 a1c2725 9fadf46 a1c2725 9fadf46 a1c2725 9fadf46 a1c2725 9fadf46 a1c2725 9fadf46 a1c2725 9fadf46 a1c2725 9fadf46 a1c2725 9fadf46 |
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
FROM ubuntu:22.04
# Set non-interactive frontend for apt
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies for LLVM script and repository
RUN apt-get update && apt-get install -y \
wget \
gnupg \
lsb-release \
&& rm -rf /var/lib/apt/lists/\*
# Add LLVM repository for Clang 18
RUN wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh 18 && \
rm llvm.sh
# Install system dependencies for bitnet.cpp and Python
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
clang-18 \
git \
python3.9 \
python3-pip \
&& rm -rf /var/lib/apt/lists/\*
# Set Clang as default compiler
ENV CC=/usr/bin/clang-18
ENV CXX=/usr/bin/clang++-18
# Create a non-root user (Hugging Face Spaces run as non-root)
RUN useradd -m -u 1000 user USER user WORKDIR /home/user/app
# Install Python dependencies
COPY requirements.txt . RUN pip3 install --no-cache-dir -r requirements.txt
# Clone and build bitnet.cpp
RUN git clone https://github.com/microsoft/BitNet.git bitnet.cpp WORKDIR /home/user/app/bitnet.cpp RUN mkdir build && cd build && \
cmake .. -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 && \
make -j$(nproc)
# Copy application code
WORKDIR /home/user/app COPY app.py .
# Expose port 7860 (required for Hugging Face Spaces)
EXPOSE 7860
# Run Gradio app
CMD ["python3", "app.py"] |