Mikeplockhart commited on
Commit
61ad695
1 Parent(s): 2309d91

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +4 -0
utils.py CHANGED
@@ -3,6 +3,7 @@ from sentence_transformers import CrossEncoder, SentenceTransformer
3
  import json
4
 
5
  def chroma_client_setup():
 
6
  chroma_client = chromadb.Client()
7
  collection = chroma_client.create_collection(
8
  name="food_collection",
@@ -11,11 +12,13 @@ def chroma_client_setup():
11
  return collection
12
 
13
  def load_data():
 
14
  with open("test_json.json", "r") as f:
15
  data = json.load(f)
16
  return data
17
 
18
  def embedding_function(items_to_embed: list[str]):
 
19
  sentence_model = SentenceTransformer(
20
  "mixedbread-ai/mxbai-embed-large-v1"
21
  )
@@ -25,6 +28,7 @@ def embedding_function(items_to_embed: list[str]):
25
  return embedded_items
26
 
27
  def chroma_upserting(collection, payload:list[dict]):
 
28
  for idx, item in enumerate(payload):
29
  print("printing item:")
30
  print(type(item))
 
3
  import json
4
 
5
  def chroma_client_setup():
6
+ print("Setup client")
7
  chroma_client = chromadb.Client()
8
  collection = chroma_client.create_collection(
9
  name="food_collection",
 
12
  return collection
13
 
14
  def load_data():
15
+ print("load data")
16
  with open("test_json.json", "r") as f:
17
  data = json.load(f)
18
  return data
19
 
20
  def embedding_function(items_to_embed: list[str]):
21
+ print("embedding")
22
  sentence_model = SentenceTransformer(
23
  "mixedbread-ai/mxbai-embed-large-v1"
24
  )
 
28
  return embedded_items
29
 
30
  def chroma_upserting(collection, payload:list[dict]):
31
+ print('upserting')
32
  for idx, item in enumerate(payload):
33
  print("printing item:")
34
  print(type(item))