mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-06 01:45:27 +03:00
Nothing major. The docs just give an error when you try to use `embeddings` instead of `llama`.
1.6 KiB
1.6 KiB
In [ ]:
!pip install llama-cpp-pythonIn [ ]:
from langchain.embeddings import LlamaCppEmbeddingsIn [ ]:
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])