quoc-khanh commited on
Commit
7ab4494
·
verified ·
1 Parent(s): d4c53ab

Update helpers.py

Browse files
Files changed (1) hide show
  1. helpers.py +9 -1
helpers.py CHANGED
@@ -302,12 +302,20 @@ def list_docx_files(folder_path):
302
  return [str(file) for file in Path(folder_path).rglob("*.docx")] + \
303
  [str(file) for file in Path(folder_path).rglob("*.pdf")]
304
 
305
- def prompt_order(queries):
306
  text = 'Câu hỏi: '
307
  for q in queries:
308
  text += f'{str(q)}. '
309
  return text
310
 
 
 
 
 
 
 
 
 
311
  def update_documents_metadata(documents, new_metadata):
312
  updated_documents = []
313
  for doc in documents:
 
302
  return [str(file) for file in Path(folder_path).rglob("*.docx")] + \
303
  [str(file) for file in Path(folder_path).rglob("*.pdf")]
304
 
305
+ def prompt_order0(queries):
306
  text = 'Câu hỏi: '
307
  for q in queries:
308
  text += f'{str(q)}. '
309
  return text
310
 
311
+ def prompt_order(queries):
312
+ text = 'IMPORTANT: Here is the questions of user in order which the current question is the last question, use that and the context above to know the best answer for the current question:\n'
313
+ i = 0
314
+ for q in queries:
315
+ i += 1
316
+ text += f'Question {i}: {str(q)}\n'
317
+ return text
318
+
319
  def update_documents_metadata(documents, new_metadata):
320
  updated_documents = []
321
  for doc in documents: