From f99a569a5e0202b9de305f915727c9cfe24ff861 Mon Sep 17 00:00:00 2001 From: Eric Hare Date: Tue, 19 Mar 2024 14:22:44 -0700 Subject: [PATCH] Use the pre-defined `model` for the model name (#212) Fixes a runtime error for that variable not being defined --- integrations/astradb.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/astradb.md b/integrations/astradb.md index cf7f044a..c8489d37 100644 --- a/integrations/astradb.md +++ b/integrations/astradb.md @@ -93,13 +93,13 @@ documents = [Document(content="There are over 7,000 languages spoken around the Document(content="Elephants have been observed to behave in a way that indicates a high level of self-awareness, such as recognizing themselves in mirrors."), Document(content="In certain parts of the world, like the Maldives, Puerto Rico, and San Diego, you can witness the phenomenon of bioluminescent waves.")] -document_embedder = SentenceTransformersDocumentEmbedder(model=model_name_or_path) +document_embedder = SentenceTransformersDocumentEmbedder(model=model) document_embedder.warm_up() documents_with_embeddings = document_embedder.run(documents) document_store.write_documents(documents_with_embeddings.get("documents")) query_pipeline = Pipeline() -query_pipeline.add_component("text_embedder", SentenceTransformersTextEmbedder(model=model_name_or_path)) +query_pipeline.add_component("text_embedder", SentenceTransformersTextEmbedder(model=model)) query_pipeline.add_component("retriever", AstraEmbeddingRetriever(document_store=document_store)) query_pipeline.connect("text_embedder.embedding", "retriever.query_embedding")