Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -137,7 +137,8 @@ def query(category, text):
|
|
137 |
]
|
138 |
)
|
139 |
answer = result.generations[0][0].text
|
140 |
-
yield gr.Chatbot.update([[question, answer]])
|
|
|
141 |
|
142 |
|
143 |
PARSING_REGEXP = r"\*\*System:\*\*\n([\s\S]+)\n\n\*\*Human:\*\*\n([\s\S]+)"
|
@@ -147,12 +148,12 @@ def parse(category, chatbot):
|
|
147 |
"""Takes the chatbot prompt and response and updates the extracted information"""
|
148 |
global PARSING_REGEXP
|
149 |
|
150 |
-
|
151 |
|
152 |
-
try:
|
153 |
-
|
154 |
-
except StopIteration:
|
155 |
-
|
156 |
|
157 |
if category not in Category.__members__:
|
158 |
# Handle the case when an invalid category is provided
|
|
|
137 |
]
|
138 |
)
|
139 |
answer = result.generations[0][0].text
|
140 |
+
#yield gr.Chatbot.update([[question, answer]])
|
141 |
+
return answer
|
142 |
|
143 |
|
144 |
PARSING_REGEXP = r"\*\*System:\*\*\n([\s\S]+)\n\n\*\*Human:\*\*\n([\s\S]+)"
|
|
|
148 |
"""Takes the chatbot prompt and response and updates the extracted information"""
|
149 |
global PARSING_REGEXP
|
150 |
|
151 |
+
answer = chatbot
|
152 |
|
153 |
+
# try:
|
154 |
+
# answer = next(chatbot)[1]
|
155 |
+
# except StopIteration:
|
156 |
+
# answer = ""
|
157 |
|
158 |
if category not in Category.__members__:
|
159 |
# Handle the case when an invalid category is provided
|