yiyii commited on
Commit
6b00e98
1 Parent(s): 7084799

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -109,12 +109,12 @@ def generate(image, pdfs, temperature=0.9, max_new_tokens=1500, top_p=0.95, repe
109
  vector_store = Chroma.from_documents(texts, embeddings, collection_metadata = {"hnsw:space":"cosine"}, persist_directory="stores/story_cosine" )
110
  print("vector store created........................")
111
 
112
- load_vector_store = Chroma(persist_directory="stores/story_cosine", embedding_function=embeddings)
113
  # persist_directory="stores/story_cosine": laod the existing vector store form "stores/story_cosine"
114
  # embedding_function=embeddings: using the bge embedding model when add the new data to the vector store
115
 
116
  # Only get the k most similar document from the dataset
117
- retriever = load_vector_store.as_retriever(search_kwargs={"k":top_k})
118
 
119
  image_caption, gender, age, emotion = get_image_info(image)
120
  print("............................................")
 
109
  vector_store = Chroma.from_documents(texts, embeddings, collection_metadata = {"hnsw:space":"cosine"}, persist_directory="stores/story_cosine" )
110
  print("vector store created........................")
111
 
112
+ # load_vector_store = Chroma(persist_directory="stores/story_cosine", embedding_function=embeddings)
113
  # persist_directory="stores/story_cosine": laod the existing vector store form "stores/story_cosine"
114
  # embedding_function=embeddings: using the bge embedding model when add the new data to the vector store
115
 
116
  # Only get the k most similar document from the dataset
117
+ retriever = vector_store.as_retriever(search_kwargs={"k":top_k})
118
 
119
  image_caption, gender, age, emotion = get_image_info(image)
120
  print("............................................")