llama CPU版本安装

1、环境要求llama-cpp-python

https://pypi.org/project/llama-cpp-python/

Requirements:
Python 3.8+
C compiler
Linux: gcc or clang
Windows: Visual Studio or MinGW
MacOS: Xcode

2、安装命令

直接pip install llama-cpp-python会报wheel错误。
Pre-built Wheel (New)
It is also possible to install a pre-built wheel with basic CPU support.

pip install llama-cpp-python \
  --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu

3、gcc安装

https://github.com/oobabooga/text-generation-webui/issues/1534

sudo apt update
sudo apt install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 60 --slave /usr/bin/g++ g++ /usr/bin/g++-11
pip install --upgrade pip
pip install --upgrade setuptools wheel
sudo apt-get install build-essential

4、libc.musl-x86_64.so.1错误

RuntimeError: Failed to load shared library ‘/nfs2/zhaochuan.cai/miniconda3/envs/reranker/lib/python3.12/site-packages/llama_cpp/lib/libllama.so’: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory

官方git:https://github.com/abetlen/llama-cpp-python/issues/1628
运行下面两行代码

apt install musl-dev
ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值