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
6 changes: 3 additions & 3 deletions app_gradio/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def get_data_column_mapping():
visible=False
)
column_content = gr.Textbox(
value="",
value="content",
placeholder="Column name of content in the input file. If exists multiple levels, use '.' separate",
label="column_content",
visible=False
Expand All @@ -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_lines=50)
summary_output = gr.Textbox(label="summary", max_height=800)
with gr.Tab("Result Detail"):
detail_output = gr.JSON(label="detail", max_height=800) # 使用JSON组件来更好地展示结构化数据

Expand Down Expand Up @@ -438,4 +438,4 @@ def get_data_column_mapping():
)

# 启动界面
demo.launch(server_port=7861, share=True)
demo.launch(share=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Removing the hardcoded server_port helps avoid port conflicts. However, this makes it difficult to use a predictable port in environments like Docker where it's often necessary.

To maintain flexibility, I suggest making the port configurable through an environment variable. This supports both dynamic port allocation for local development and fixed ports for deployment. This pattern is already present in the codebase (e.g., LOCAL_DEPLOYMENT_MODE).

Suggested change
demo.launch(share=True)
demo.launch(server_port=int(os.getenv("GRADIO_SERVER_PORT", "7860")), share=True)