Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -329,19 +329,19 @@ def chat(question, manual, history, liked, graded_doc_history):
|
|
329 |
|
330 |
path = "Contents/" + manual + ".json"
|
331 |
|
332 |
-
|
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 |
-
|
340 |
|
341 |
-
|
342 |
-
|
343 |
|
344 |
-
|
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 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
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 |
|