Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -122,6 +122,9 @@ def _launch_demo(args):
|
|
| 122 |
)
|
| 123 |
|
| 124 |
def predict(_chatbot, task_history):
|
|
|
|
|
|
|
|
|
|
| 125 |
chat_query = _chatbot[-1][0]
|
| 126 |
query = task_history[-1][0]
|
| 127 |
if len(chat_query) == 0:
|
|
@@ -171,23 +174,13 @@ def _launch_demo(args):
|
|
| 171 |
_chatbot[-1] = (_parse_text(chat_query), _remove_image_special(''.join(response_text)))
|
| 172 |
yield _chatbot
|
| 173 |
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
# f.write(resp.content)
|
| 182 |
-
# response = ''.join(r['box'] if 'box' in r else r['text'] for r in response[:-1])
|
| 183 |
-
# _chatbot.append((None, (filename,)))
|
| 184 |
-
# else:
|
| 185 |
-
# _chatbot[-1] = (_parse_text(chat_query), response)
|
| 186 |
-
# full_response = _parse_text(response)
|
| 187 |
-
|
| 188 |
-
# task_history[-1] = (query, full_response)
|
| 189 |
-
# print("Qwen2.5-VL-Chat: " + _parse_text(full_response))
|
| 190 |
-
# yield _chatbot
|
| 191 |
|
| 192 |
|
| 193 |
def regenerate(_chatbot, task_history):
|
|
@@ -264,4 +257,4 @@ def main():
|
|
| 264 |
|
| 265 |
|
| 266 |
if __name__ == '__main__':
|
| 267 |
-
main()
|
|
|
|
| 122 |
)
|
| 123 |
|
| 124 |
def predict(_chatbot, task_history):
|
| 125 |
+
|
| 126 |
+
print("chatbot", _chatbot)
|
| 127 |
+
print("history",task_history)
|
| 128 |
chat_query = _chatbot[-1][0]
|
| 129 |
query = task_history[-1][0]
|
| 130 |
if len(chat_query) == 0:
|
|
|
|
| 174 |
_chatbot[-1] = (_parse_text(chat_query), _remove_image_special(''.join(response_text)))
|
| 175 |
yield _chatbot
|
| 176 |
|
| 177 |
+
|
| 178 |
+
_chatbot[-1] = (_parse_text(chat_query), _remove_image_special(''.join(response_text)))
|
| 179 |
+
full_response = _parse_text(''.join(response_text))
|
| 180 |
+
|
| 181 |
+
task_history[-1] = (query, full_response)
|
| 182 |
+
print("Qwen2.5-VL-Chat: " + _parse_text(full_response))
|
| 183 |
+
yield _chatbot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
|
| 185 |
|
| 186 |
def regenerate(_chatbot, task_history):
|
|
|
|
| 257 |
|
| 258 |
|
| 259 |
if __name__ == '__main__':
|
| 260 |
+
main()
|