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.
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
运行下面两行代码