tykiww commited on
Commit
8e1c60e
1 Parent(s): 298eabd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -2
app.py CHANGED
@@ -7,8 +7,9 @@ import gradio as gr
7
  from utilities.setup import get_files
8
  #from server import EmbeddingService, QAService
9
 
10
-
11
  from services.embed_service.embed import EmbeddingService
 
12
  from server import QAService
13
 
14
  #import spaces
@@ -17,7 +18,7 @@ from server import QAService
17
  def process_transcripts(files, context):
18
 
19
  print(files)
20
- with EmbeddingService(conf) as e:
21
  f = e.run(files)
22
  # some way to wait or a progress bar?
23
  return "Completed Loading Data"
@@ -74,4 +75,20 @@ def main(conf):
74
  if __name__ == "__main__":
75
  # Get config
76
  conf = get_files.json_cfg()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  main(conf)
 
7
  from utilities.setup import get_files
8
  #from server import EmbeddingService, QAService
9
 
10
+ from connections.pincone import PineconeConnector
11
  from services.embed_service.embed import EmbeddingService
12
+
13
  from server import QAService
14
 
15
  #import spaces
 
18
  def process_transcripts(files, context):
19
 
20
  print(files)
21
+ with EmbeddingService(conf, pinecone=pinecones) as e:
22
  f = e.run(files)
23
  # some way to wait or a progress bar?
24
  return "Completed Loading Data"
 
75
  if __name__ == "__main__":
76
  # Get config
77
  conf = get_files.json_cfg()
78
+
79
+ # Get keys
80
+ keys = get_files.get_keys()
81
+
82
+ # initialize pinecone connector
83
+ pc_connector = PineconeConnector(
84
+ api_key=keys["pinecone"],
85
+ index_name=conf["embeddings"]["index_name"],
86
+ embedding=conf["embeddings"]["embedding"],
87
+ )
88
+
89
+ pinecones = pc_connector.run()
90
+
91
+ # initialize model connector
92
+
93
+ # run main
94
  main(conf)