Skip to content

Commit

Permalink
Use the pre-defined model for the model name (#212)
Browse files Browse the repository at this point in the history
Fixes a runtime error for that variable not being defined
  • Loading branch information
erichare authored Mar 19, 2024
1 parent 9bd8744 commit f99a569
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions integrations/astradb.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit f99a569

Please sign in to comment.