tykiww commited on
Commit
31c1456
1 Parent(s): c2a146f

Update services/embed_service/embed.py

Browse files
Files changed (1) hide show
  1. services/embed_service/embed.py +6 -6
services/embed_service/embed.py CHANGED
@@ -2,9 +2,10 @@ import os
2
  from utils import get_files, VTTTranscriptLoader, DocumentEmbedder
3
 
4
  class EmbeddingService:
5
- def __init__(self, conf):
6
- self.keys = get_files.get_keys()
7
  self.conf = conf
 
 
8
 
9
  def __enter__(self):
10
  print("Start Embedding Service")
@@ -24,12 +25,11 @@ class EmbeddingService:
24
  def run(self, files):
25
  # gets the files, cleans them, and loads them into pinecone
26
  results = self.get_transcripts(files)
27
-
28
  doc_embedder = DocumentEmbedder(
29
- api_keys=self.keys,
30
  files=results,
31
- embedding=self.conf["embeddings"]["embedding"],
32
- index_name=self.conf["embeddings"]["index_name"],
33
  )
34
 
35
  # uploads them into pinecone
 
2
  from utils import get_files, VTTTranscriptLoader, DocumentEmbedder
3
 
4
  class EmbeddingService:
5
+ def __init__(self, conf, pinecone):
 
6
  self.conf = conf
7
+ self.pc = pinecone['service']
8
+ self.embedder = pinecone['embedder']
9
 
10
  def __enter__(self):
11
  print("Start Embedding Service")
 
25
  def run(self, files):
26
  # gets the files, cleans them, and loads them into pinecone
27
  results = self.get_transcripts(files)
28
+
29
  doc_embedder = DocumentEmbedder(
30
+ pinecone_pipeline=self.pc,
31
  files=results,
32
+ embedder=self.embedder
 
33
  )
34
 
35
  # uploads them into pinecone