Skip to main content

Llama-cpp

本笔记本介绍如何在 LangChain 中使用 Llama-cpp 嵌入

%pip install --upgrade --quiet  llama-cpp-python
from langchain_community.embeddings import LlamaCppEmbeddings
llama = LlamaCppEmbeddings(model_path="/path/to/model/ggml-model-q4_0.bin")
text = "This is a test document."
query_result = llama.embed_query(text)
doc_result = llama.embed_documents([text])

相关


此页面是否有帮助?


您还可以留下详细的反馈 在 GitHub 上