Spaces:
Sleeping
Sleeping
Aiswarya Sankar
commited on
Commit
·
fb759cc
1
Parent(s):
ad11507
update file
Browse files
app.py
CHANGED
@@ -419,8 +419,12 @@ def solveGithubIssue(ticket, history) -> Response:
|
|
419 |
|
420 |
history = [[q_display, ""]]
|
421 |
history[-1][1] = ""
|
|
|
|
|
|
|
|
|
422 |
print(history)
|
423 |
-
for char in qa({"question": question, "chat_history":
|
424 |
history[-1][1] += char
|
425 |
yield history
|
426 |
|
@@ -468,7 +472,10 @@ def bot(history, **kwargs):
|
|
468 |
|
469 |
print(history)
|
470 |
history[-1][1] = ""
|
471 |
-
for
|
|
|
|
|
|
|
472 |
history[-1][1] += char
|
473 |
yield history
|
474 |
|
|
|
419 |
|
420 |
history = [[q_display, ""]]
|
421 |
history[-1][1] = ""
|
422 |
+
# Flatten the list of lists
|
423 |
+
flat_list = [item for sublist in history for item in sublist]
|
424 |
+
flat_list = [item for item in flat_list if item is not None]
|
425 |
+
|
426 |
print(history)
|
427 |
+
for char in qa({"question": question, "chat_history": flat_list})["answer"]:
|
428 |
history[-1][1] += char
|
429 |
yield history
|
430 |
|
|
|
472 |
|
473 |
print(history)
|
474 |
history[-1][1] = ""
|
475 |
+
flat_list = [item for sublist in history for item in sublist]
|
476 |
+
flat_list = [item for item in flat_list if item is not None]
|
477 |
+
|
478 |
+
for char in qa({"question": user_message, "chat_history": flat_list})["answer"]:
|
479 |
history[-1][1] += char
|
480 |
yield history
|
481 |
|