javaeeduke commited on
Commit
bae099f
·
verified ·
1 Parent(s): 67746c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -23
app.py CHANGED
@@ -103,7 +103,7 @@ def main(keyword):
103
  return article, images, videos
104
 
105
  # =====================
106
- # Gradio界面布局
107
  # =====================
108
  with gr.Blocks(title="头条 AI Agent") as demo:
109
 
@@ -125,8 +125,7 @@ with gr.Blocks(title="头条 AI Agent") as demo:
125
  with gr.Column(scale=2):
126
  article_output = gr.Textbox(
127
  label="生成文章",
128
- lines=22,
129
- show_copy_button=True # 开启一键复制功能,方便搬运
130
  )
131
 
132
  # 右栏:素材匹配
@@ -136,23 +135,4 @@ with gr.Blocks(title="头条 AI Agent") as demo:
136
  columns=2,
137
  rows=3,
138
  height=350
139
- )
140
-
141
- # 视频链接包裹在一个基础小框里,保持视觉整洁
142
- with gr.Box():
143
- video_output = gr.Markdown(
144
- label="素材视频链接"
145
- )
146
-
147
- # 绑定点击事件
148
- btn.click(
149
- fn=main,
150
- inputs=keyword_input,
151
- outputs=[
152
- article_output,
153
- gallery_output,
154
- video_output
155
- ]
156
- )
157
-
158
- demo.launch()
 
103
  return article, images, videos
104
 
105
  # =====================
106
+ # Gradio界面布局(安全兼容版)
107
  # =====================
108
  with gr.Blocks(title="头条 AI Agent") as demo:
109
 
 
125
  with gr.Column(scale=2):
126
  article_output = gr.Textbox(
127
  label="生成文章",
128
+ lines=22
 
129
  )
130
 
131
  # 右栏:素材匹配
 
135
  columns=2,
136
  rows=3,
137
  height=350
138
+ )