Tonic commited on
Commit
e8d06a3
·
1 Parent(s): c17c16b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -20,6 +20,9 @@ weaviate_url = os.getenv('WEAVIATE_URL')
20
  # Weaviate connection
21
  auth_config = weaviate.auth.AuthApiKey(api_key=weaviate_api_key)
22
  client = weaviate.Client(url=weaviate_url, auth_client_secret=auth_config, additional_headers={"X-Cohere-Api-Key": cohere_api_key})
 
 
 
23
  vectorstore._query_attrs = ["text", "title", "url", "views", "lang", "_additional {distance}"]
24
  vectorstore.embedding = CohereEmbeddings(model="embed-multilingual-v2.0", cohere_api_key=cohere_api_key)
25
 
 
20
  # Weaviate connection
21
  auth_config = weaviate.auth.AuthApiKey(api_key=weaviate_api_key)
22
  client = weaviate.Client(url=weaviate_url, auth_client_secret=auth_config, additional_headers={"X-Cohere-Api-Key": cohere_api_key})
23
+
24
+ # Initialize vectorstore
25
+ vectorstore = Weaviate(client, index_name="Articles", text_key="text")
26
  vectorstore._query_attrs = ["text", "title", "url", "views", "lang", "_additional {distance}"]
27
  vectorstore.embedding = CohereEmbeddings(model="embed-multilingual-v2.0", cohere_api_key=cohere_api_key)
28