Llama.cpp
本页面介绍了如何在LangChain中使用llama.cpp。它分为两个部分:安装和设置,以及对特定的Llama-cpp包装器的引用。
安装和设置
使用
pip install llama-cpp-python
安装Python包。根据说明下载并将其中一个支持的模型转换为llama.cpp格式。
包装器
LLM
存在一个LlamaCpp LLM包装器,您可以使用以下代码访问:
from langchain_community.llms import LlamaCpp
有关更详细的步骤,请参见此笔记本。
嵌入
存在一个LlamaCpp嵌入包装器,您可以使用以下代码访问:
from langchain_community.embeddings import LlamaCppEmbeddings
有关更详细的步骤,请参见此笔记本。