soyleyicicem commited on
Commit
d3245c3
·
verified ·
1 Parent(s): 8ddb521

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -23
app.py CHANGED
@@ -329,19 +329,19 @@ def chat(question, manual, history, liked, graded_doc_history):
329
 
330
  path = "Contents/" + manual + ".json"
331
 
332
- #start_time = time.time()
333
  documents = []
334
  for i in arg_list:
335
  documents.append(get_section_content(str(i['section_title']), str(i['sub_section_title']), str(i['sub_sub_section_title']), content_path=path))
336
 
337
  CAR_ID = manual_list[manual]
338
 
339
- #documents_db = retriever_db(qclient, question, collection_name, CAR_ID)
340
 
341
- #for i in documents_db:
342
- # documents.append(i)
343
 
344
- #print("Retriever:--- %s seconds ---" % (time.time() - start_time))
345
 
346
  start_time = time.time()
347
  graded_doc = []
@@ -355,24 +355,24 @@ def chat(question, manual, history, liked, graded_doc_history):
355
 
356
  print("Onaylanan Doküman Sayısı:", len(graded_doc))
357
 
358
- if not graded_doc:
359
- documents = []
360
- CAR_ID = manual_list[manual]
361
-
362
- documents_db = retriever_db(qclient, question, collection_name, CAR_ID)
363
-
364
- for i in documents_db:
365
- documents.append(i)
366
-
367
- for r in documents:
368
-
369
- grade = grade_document_with_openai(r, question)
370
-
371
- if grade.binary_score == "yes":
372
- graded_doc.append(r)
373
- graded_doc_history.append(r)
374
-
375
- print("Onaylanan Doküman Sayısı DB:", len(graded_doc))
376
  print("Grade Doc:--- %s seconds ---" % (time.time() - start_time))
377
 
378
 
 
329
 
330
  path = "Contents/" + manual + ".json"
331
 
332
+ start_time = time.time()
333
  documents = []
334
  for i in arg_list:
335
  documents.append(get_section_content(str(i['section_title']), str(i['sub_section_title']), str(i['sub_sub_section_title']), content_path=path))
336
 
337
  CAR_ID = manual_list[manual]
338
 
339
+ documents_db = retriever_db(qclient, question, collection_name, CAR_ID)
340
 
341
+ for i in documents_db:
342
+ documents.append(i)
343
 
344
+ print("Retriever:--- %s seconds ---" % (time.time() - start_time))
345
 
346
  start_time = time.time()
347
  graded_doc = []
 
355
 
356
  print("Onaylanan Doküman Sayısı:", len(graded_doc))
357
 
358
+ #if not graded_doc:
359
+ # documents = []
360
+ # CAR_ID = manual_list[manual]
361
+ #
362
+ # documents_db = retriever_db(qclient, question, collection_name, CAR_ID)
363
+ #
364
+ # for i in documents_db:
365
+ # documents.append(i)
366
+ #
367
+ # for r in documents:
368
+ #
369
+ # grade = grade_document_with_openai(r, question)
370
+ #
371
+ # if grade.binary_score == "yes":
372
+ # graded_doc.append(r)
373
+ # graded_doc_history.append(r)
374
+ #
375
+ # print("Onaylanan Doküman Sayısı DB:", len(graded_doc))
376
  print("Grade Doc:--- %s seconds ---" % (time.time() - start_time))
377
 
378