Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -55,14 +55,13 @@ def generate_variations(question):
|
|
55 |
|
56 |
|
57 |
|
58 |
-
my_string = question
|
59 |
output = extract(input2)
|
60 |
output_list = output.split("\n")
|
61 |
final_list = [my_string] + output_list
|
62 |
print(final_list)
|
63 |
|
64 |
-
|
65 |
-
|
66 |
|
67 |
return final_list
|
68 |
|
@@ -149,13 +148,14 @@ def get_answer(query_string):
|
|
149 |
|
150 |
|
151 |
def get_answer2(list_thing):
|
152 |
-
|
153 |
for question in list_thing:
|
154 |
answer = get_answer(question)
|
155 |
-
|
|
|
156 |
|
157 |
-
|
158 |
-
|
159 |
|
160 |
|
161 |
|
@@ -164,11 +164,8 @@ def get_answer2(list_thing):
|
|
164 |
def qa_app(query):
|
165 |
question_list = generate_variations(query)
|
166 |
big_answer = get_answer2(question_list)
|
167 |
-
final_answer = consolidated_answer(big_answer, query)
|
168 |
-
return
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
|
173 |
|
174 |
inputs = gr.inputs.Textbox(label="Enter your question:")
|
|
|
55 |
|
56 |
|
57 |
|
58 |
+
my_string = "0. " + question
|
59 |
output = extract(input2)
|
60 |
output_list = output.split("\n")
|
61 |
final_list = [my_string] + output_list
|
62 |
print(final_list)
|
63 |
|
64 |
+
|
|
|
65 |
|
66 |
return final_list
|
67 |
|
|
|
148 |
|
149 |
|
150 |
def get_answer2(list_thing):
|
151 |
+
responses = []
|
152 |
for question in list_thing:
|
153 |
answer = get_answer(question)
|
154 |
+
response = f"{question}\n{answer}"
|
155 |
+
responses.append(response)
|
156 |
|
157 |
+
return "\n\n".join(responses)
|
158 |
+
|
159 |
|
160 |
|
161 |
|
|
|
164 |
def qa_app(query):
|
165 |
question_list = generate_variations(query)
|
166 |
big_answer = get_answer2(question_list)
|
167 |
+
#final_answer = consolidated_answer(big_answer, query)
|
168 |
+
return big_answer
|
|
|
|
|
|
|
169 |
|
170 |
|
171 |
inputs = gr.inputs.Textbox(label="Enter your question:")
|