From 445083074b1a1e1a6d0b4b7257ce9c5cd751e13a Mon Sep 17 00:00:00 2001 From: Stefano Fiorucci Date: Thu, 15 Feb 2024 09:44:47 +0100 Subject: [PATCH] update jina article - new secrets management (#299) --- content/blog/using-jina-embeddings-haystack/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/blog/using-jina-embeddings-haystack/index.md b/content/blog/using-jina-embeddings-haystack/index.md index 1bd873a1..ade5a9a5 100644 --- a/content/blog/using-jina-embeddings-haystack/index.md +++ b/content/blog/using-jina-embeddings-haystack/index.md @@ -58,7 +58,7 @@ Then let's input our credentials. Or you can set them as environment variables i from getpass import getpass import os -jina_api_key = getpass("JINA api key:") +os.environ["JINA_API_KEY"] = getpass("JINA api key:") os.environ["HF_API_TOKEN"] = getpass("Enter your HuggingFace api token: ") ``` @@ -102,7 +102,7 @@ writer = DocumentWriter(document_store=document_store, policy=DuplicatePolicy.SK retriever = ChromaEmbeddingRetriever(document_store=document_store) -document_embedder = JinaDocumentEmbedder(api_key=jina_api_key, model="jina-embeddings-v2-base-en") +document_embedder = JinaDocumentEmbedder(model="jina-embeddings-v2-base-en") indexing_pipeline = Pipeline() indexing_pipeline.add_component(instance=fetcher, name="fetcher") @@ -147,7 +147,7 @@ Documents: question: {{question}} """ -text_embedder = JinaTextEmbedder(api_key=jina_api_key, model="jina-embeddings-v2-base-en") +text_embedder = JinaTextEmbedder(model="jina-embeddings-v2-base-en") generator = HuggingFaceTGIGenerator("mistralai/Mixtral-8x7B-Instruct-v0.1") generator.warm_up()