Skip to content

Commit

Permalink
llama.cpp - update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Mar 1, 2024
1 parent 979a812 commit 47ad128
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from haystack_integrations.components.generators.llama_cpp import LlamaCppGenerator

generator = LlamaCppGenerator(model_path="openchat-3.5-1210.Q3_K_S.gguf", n_ctx=512, n_batch=128)
generator = LlamaCppGenerator(model="openchat-3.5-1210.Q3_K_S.gguf", n_ctx=512, n_batch=128)
generator.warm_up()

question = "Who is the best American actor?"
Expand Down
10 changes: 5 additions & 5 deletions integrations/llama_cpp/examples/rag_pipeline_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

# Indexing Pipeline
indexing_pipeline = Pipeline()
indexing_pipeline.add_component(instance=doc_embedder, name="DocEmbedder")
indexing_pipeline.add_component(instance=DocumentWriter(document_store=doc_store), name="DocWriter")
indexing_pipeline.connect(connect_from="DocEmbedder", connect_to="DocWriter")
indexing_pipeline.add_component(instance=doc_embedder, name="doc_embedder")
indexing_pipeline.add_component(instance=DocumentWriter(document_store=doc_store), name="doc_writer")
indexing_pipeline.connect("doc_embedder", "doc_writer")

indexing_pipeline.run({"DocEmbedder": {"documents": docs}})
indexing_pipeline.run({"doc_embedder": {"documents": docs}})


# RAG Pipeline
Expand All @@ -50,7 +50,7 @@
text_embedder = SentenceTransformersTextEmbedder(model="sentence-transformers/all-MiniLM-L6-v2")

model_path = "openchat-3.5-1210.Q3_K_S.gguf"
generator = LlamaCppGenerator(model_path=model_path, n_ctx=4096, n_batch=128)
generator = LlamaCppGenerator(model=model_path, n_ctx=4096, n_batch=128)

rag_pipeline.add_component(
instance=text_embedder,
Expand Down

0 comments on commit 47ad128

Please sign in to comment.