IT评测·应用市场-qidao123.com

标题: llama CPU版本安装 [打印本页]

作者: 罪恶克星    时间: 2025-3-6 23:36
标题: 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.
  1. pip install llama-cpp-python \
  2.   --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
复制代码
3、gcc安装

https://github.com/oobabooga/text-generation-webui/issues/1534
  1. sudo apt update
  2. sudo apt install gcc-11 g++-11
  3. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 60 --slave /usr/bin/g++ g++ /usr/bin/g++-11
  4. pip install --upgrade pip
  5. pip install --upgrade setuptools wheel
  6. 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
运行下面两行代码
  1. apt install musl-dev
  2. ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 IT评测·应用市场-qidao123.com (https://dis.qidao123.com/) Powered by Discuz! X3.4