cicboy commited on
Commit
e30c01e
Β·
1 Parent(s): 2fe9eb8

update Gradio UI

Browse files
Files changed (1) hide show
  1. app.py +17 -5
app.py CHANGED
@@ -149,10 +149,22 @@ def generate_blog(topic, tone):
149
  yield final_text
150
 
151
  # Build Gradio Interface
152
- with gr.Blocks(theme=gr.themes.Glass(primary_hue="purple")) as demo:
 
 
 
 
 
 
 
 
 
 
 
 
153
  gr.Markdown(
154
  """
155
- # ✍️ AI Blog Writer Multi-Agent
156
  Create a professional, fact-checked, and polished article using CrewAI agents.
157
  """
158
  )
@@ -164,15 +176,15 @@ with gr.Blocks(theme=gr.themes.Glass(primary_hue="purple")) as demo:
164
  value="Sustainable Investing"
165
  )
166
  tone=gr.Dropdown(
167
- ["professional", "playful", "academic", "casual", "satirical"],
168
  label="Select Writing Tone",
169
  value="academic"
170
  )
171
 
172
  run_button = gr.Button("πŸš€ Generate Blog", variant="primary")
173
- output = gr.Markdown(label="πŸ“° Generated Blog Post")
174
 
175
- run_button.click(generate_blog, inputs=[topic, tone], outputs=output)
176
 
177
  #Launch app
178
  if __name__=="__main__":
 
149
  yield final_text
150
 
151
  # Build Gradio Interface
152
+ with gr.Blocks(css="""
153
+ #output-box {
154
+ background-color: #f8f9fa;
155
+ border-radius: 12px;
156
+ padding: 1.5rem;
157
+ font-family: 'Inter', sans-serif;
158
+ font-size: 1rem;
159
+ line-height: 1.6;
160
+ white-space: pre-wrap;
161
+ overflow-y: auto;
162
+ max-height: 70vh;
163
+ }
164
+ """) as demo:
165
  gr.Markdown(
166
  """
167
+ ## ✍️ AI Blog Writer Multi-Agent
168
  Create a professional, fact-checked, and polished article using CrewAI agents.
169
  """
170
  )
 
176
  value="Sustainable Investing"
177
  )
178
  tone=gr.Dropdown(
179
+ ["professional", "playful", "academic", "casual", "satirical", "humorous"],
180
  label="Select Writing Tone",
181
  value="academic"
182
  )
183
 
184
  run_button = gr.Button("πŸš€ Generate Blog", variant="primary")
185
+ output = gr.Textbox(label="πŸ“° Generated Blog Post", elem_id="output-box", lines=25, interactive=False, show_label=False)
186
 
187
+ run_button.click(generate_blog, inputs=[topic, tone], outputs=[output])
188
 
189
  #Launch app
190
  if __name__=="__main__":