Tonic commited on
Commit
99dc3b5
1 Parent(s): a86354d

fix upload documents

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. globalvars.py +1 -0
app.py CHANGED
@@ -190,8 +190,8 @@ def upload_documents(files):
190
  for file in files:
191
  loader = UnstructuredFileLoader(file.name)
192
  documents = loader.load()
193
- add_documents_to_chroma(chroma_client, chroma_collection, documents, embedding_function)
194
- return "Documents uploaded and processed successfully!"
195
 
196
  def query_documents(query):
197
  results = query_chroma(query)
 
190
  for file in files:
191
  loader = UnstructuredFileLoader(file.name)
192
  documents = loader.load()
193
+ add_documents_to_chroma(documents, embedding_function)
194
+ return "Documents uploaded and processed successfully!"
195
 
196
  def query_documents(query):
197
  results = query_chroma(query)
globalvars.py CHANGED
@@ -25,6 +25,7 @@ tasks = {
25
  'NQ': 'Given a question, retrieve Wikipedia passages that answer the question',
26
  'QuoraRetrieval': 'Given a question, retrieve questions that are semantically equivalent to the given question',
27
  'SCIDOCS': 'Given a scientific paper title, retrieve paper abstracts that are cited by the given paper',
 
28
  }
29
 
30
  intention_prompt= """
 
25
  'NQ': 'Given a question, retrieve Wikipedia passages that answer the question',
26
  'QuoraRetrieval': 'Given a question, retrieve questions that are semantically equivalent to the given question',
27
  'SCIDOCS': 'Given a scientific paper title, retrieve paper abstracts that are cited by the given paper',
28
+ 'DEFAULT': 'Given a query, retrieve relevant entity descriptions from DBPedia',
29
  }
30
 
31
  intention_prompt= """