Files
Matt Royer ad87584c35 Fix 'embeddings is not defined' (#2468)
Nothing major. The docs just give an error when you try to use
`embeddings` instead of `llama`.
2023-04-06 12:45:45 -07:00

1.6 KiB

Llama-cpp

This notebook goes over how to use Llama-cpp embeddings within LangChain

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