JPBianchi commited on
Commit
79b8126
1 Parent(s): b4cbaad

vectorstore client issue

Browse files
Files changed (2) hide show
  1. app/engine/vectorstore.py +9 -9
  2. app/settings.py +0 -1
app/engine/vectorstore.py CHANGED
@@ -6,7 +6,7 @@ from weaviate.classes.config import Property, DataType
6
  from .weaviate_interface_v4 import WeaviateWCS, WeaviateIndexer
7
  from .logger import logger
8
 
9
- from settings import parquet_file, s1
10
 
11
  class VectorStore:
12
  def __init__(self, model_path:str = 'sentence-transformers/all-mpnet-base-v2'):
@@ -58,12 +58,12 @@ class VectorStore:
58
 
59
  try:
60
  print("We were here")
61
- print("key", os.environ.get('FINRAG_WEAVIATE_API_KEY'))
62
- # self.api_key = os.environ.get('FINRAG_WEAVIATE_API_KEY')
63
- # self.url = os.environ.get('FINRAG_WEAVIATE_ENDPOINT')
64
  print('Before client creation')
65
- self.client = WeaviateWCS(endpoint="https://finrag-uflmnhbp.weaviate.network",
66
- api_key=s1+'OOf',
67
  model_name_or_path=self.model_path)
68
  print('After client creation')
69
 
@@ -71,9 +71,9 @@ class VectorStore:
71
  # raise Exception(f"Could not create Weaviate client: {e}")
72
  print(f"Could not create Weaviate client: {e}")
73
 
74
- print("URL", os.environ.get('FINRAG_WEAVIATE_ENDPOINT'))
75
- assert self.client._client.is_live(), "Weaviate is not live"
76
- assert self.client._client.is_ready(), "Weaviate is not ready"
77
  # careful with accessing '_client' since the weaviate helper usually closes the connection every time
78
 
79
  self.indexer = None
 
6
  from .weaviate_interface_v4 import WeaviateWCS, WeaviateIndexer
7
  from .logger import logger
8
 
9
+ from settings import parquet_file
10
 
11
  class VectorStore:
12
  def __init__(self, model_path:str = 'sentence-transformers/all-mpnet-base-v2'):
 
58
 
59
  try:
60
  print("We were here")
61
+ print("URL1", os.environ.get('FINRAG_WEAVIATE_ENDPOINT'))
62
+ self.api_key = os.environ.get('FINRAG_WEAVIATE_API_KEY')
63
+ self.url = os.environ.get('FINRAG_WEAVIATE_ENDPOINT')
64
  print('Before client creation')
65
+ self.client = WeaviateWCS(endpoint=self.url,
66
+ api_key=self.api_key,
67
  model_name_or_path=self.model_path)
68
  print('After client creation')
69
 
 
71
  # raise Exception(f"Could not create Weaviate client: {e}")
72
  print(f"Could not create Weaviate client: {e}")
73
 
74
+ print("URL2", os.environ.get('FINRAG_WEAVIATE_ENDPOINT'))
75
+ # assert self.client._client.is_live(), "Weaviate is not live"
76
+ # assert self.client._client.is_ready(), "Weaviate is not ready"
77
  # careful with accessing '_client' since the weaviate helper usually closes the connection every time
78
 
79
  self.indexer = None
app/settings.py CHANGED
@@ -2,4 +2,3 @@ import os
2
 
3
  datadir = '../data' # will be used in main.py
4
  parquet_file = os.path.join(datadir, 'text_vectors.parquet') # used by the files in 'engine'
5
- s1 = "ypgRtW7Ri0MoAmKWzjanItFXT9K1S34t6"
 
2
 
3
  datadir = '../data' # will be used in main.py
4
  parquet_file = os.path.join(datadir, 'text_vectors.parquet') # used by the files in 'engine'