Spaces:
Sleeping
Sleeping
Zanqi commited on
Commit ·
c676437
1
Parent(s): d2b03f5
Fix final_answer assignment and update image content handling in stream_to_gradio function
Browse files- Gradio_UI.py +2 -2
Gradio_UI.py
CHANGED
|
@@ -153,7 +153,7 @@ def stream_to_gradio(
|
|
| 153 |
):
|
| 154 |
yield message
|
| 155 |
|
| 156 |
-
final_answer = step_log # Last log is the run's final_answer
|
| 157 |
final_answer = handle_agent_output_types(final_answer)
|
| 158 |
|
| 159 |
if isinstance(final_answer, AgentText):
|
|
@@ -165,7 +165,7 @@ def stream_to_gradio(
|
|
| 165 |
yield gr.ChatMessage(
|
| 166 |
role="assistant",
|
| 167 |
# content={"path": final_answer.to_string(), "mime_type": "image/png"},
|
| 168 |
-
content=gr.Image(str(final_answer
|
| 169 |
metadata={"mime_type": "image/png"},
|
| 170 |
)
|
| 171 |
elif isinstance(final_answer, AgentAudio):
|
|
|
|
| 153 |
):
|
| 154 |
yield message
|
| 155 |
|
| 156 |
+
final_answer = step_log.final_answer # Last log is the run's final_answer
|
| 157 |
final_answer = handle_agent_output_types(final_answer)
|
| 158 |
|
| 159 |
if isinstance(final_answer, AgentText):
|
|
|
|
| 165 |
yield gr.ChatMessage(
|
| 166 |
role="assistant",
|
| 167 |
# content={"path": final_answer.to_string(), "mime_type": "image/png"},
|
| 168 |
+
content=gr.Image(str(final_answer)),
|
| 169 |
metadata={"mime_type": "image/png"},
|
| 170 |
)
|
| 171 |
elif isinstance(final_answer, AgentAudio):
|