Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app_gradio/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def get_data_column_mapping():
# 修改输出组件部分,使用Tabs
with gr.Tabs():
with gr.Tab("Result Summary"):
summary_output = gr.Textbox(label="summary", max_height=800)
summary_output = gr.JSON(label="summary", max_height=800)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using gr.JSON for the summary output is a good improvement for better visualization. However, the dingo_demo function currently returns a JSON string for the summary (from json.dumps(summary, indent=4) on line 101).

The gr.JSON component expects a Python dictionary or list to render it as an interactive JSON object. When a string is passed, it will just display the raw string.

To fix this, you should modify dingo_demo to return the summary dictionary directly, instead of a JSON string.

For example, on line 101:

return summary, new_detail

with gr.Tab("Result Detail"):
detail_output = gr.JSON(label="detail", max_height=800) # 使用JSON组件来更好地展示结构化数据

Expand Down