microsoft/bitnet-b1.58-2B-4T · Hugging Face
hf download microsoft/bitnet-b1.58-2B-4T-gguf --local-dir models/bitnet
# BitNet App
git clone <https://github.com/microsoft/BitNet>
cd BitNet
pip install -r requirements.txt
# 모델 다운로드 (Hugging Face) - microsoft/bitnet-b1.58-2B-4T
hf download microsoft/bitnet-b1.58-2B-4T-gguf --local-dir models/bitnet
# 1. Python으로 커널 헤더 파일 생성
python utils/generate_lookup_table.py
# 또는 setup_env.py가 이 작업을 할 수도 있음
python setup_env.py
# 2. 생성된 파일 확인
ls include/bitnet-lut-kernels.h
# 1. 먼저 CMake로 빌드 설정
cmake -B build -S .
# 2. 컴파일
cmake --build build --config Release
# 또는 make 사용
cd build
make -j$(nproc)
cd ..
# bitnet.cpp로 실행
./build/bin/main -m models/bitnet-b1.58-2B-4T
python setup_env.py \ --model models/bitnet \ --quant i2_e