Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -40,10 +40,10 @@ async def perform_document_qa(
|
|
40 |
question.strip()
|
41 |
)
|
42 |
|
43 |
-
#
|
44 |
-
|
45 |
|
46 |
-
answers_dict[question] =
|
47 |
|
48 |
return answers_dict
|
49 |
except Exception as e:
|
@@ -69,10 +69,10 @@ async def load_file(
|
|
69 |
question.strip()
|
70 |
)
|
71 |
|
72 |
-
#
|
73 |
-
|
74 |
|
75 |
-
answers_dict[question] =
|
76 |
|
77 |
return answers_dict
|
78 |
except Exception as e:
|
|
|
40 |
question.strip()
|
41 |
)
|
42 |
|
43 |
+
# Access the 'answer' key from the first item in the result list
|
44 |
+
answer = result[0]['answer']
|
45 |
|
46 |
+
answers_dict[question] = answer
|
47 |
|
48 |
return answers_dict
|
49 |
except Exception as e:
|
|
|
69 |
question.strip()
|
70 |
)
|
71 |
|
72 |
+
# Access the 'answer' key from the first item in the result list
|
73 |
+
answer = result[0]['answer']
|
74 |
|
75 |
+
answers_dict[question] = answer
|
76 |
|
77 |
return answers_dict
|
78 |
except Exception as e:
|