adil9858 commited on
Commit
abd0964
Β·
verified Β·
1 Parent(s): 8d358f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -4
app.py CHANGED
@@ -165,11 +165,10 @@ with gr.Blocks(title="DocSum - Document Summarizer", theme=gr.themes.Soft()) as
165
 
166
  submit_btn = gr.Button("πŸ” Analyze Document", variant="primary")
167
 
168
- output = gr.Textbox(
 
169
  label="Analysis Results",
170
- interactive=False,
171
- lines=20,
172
- max_lines=50
173
  )
174
 
175
  submit_btn.click(
@@ -178,5 +177,27 @@ with gr.Blocks(title="DocSum - Document Summarizer", theme=gr.themes.Soft()) as
178
  outputs=output
179
  )
180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  if __name__ == "__main__":
182
  demo.launch()
 
165
 
166
  submit_btn = gr.Button("πŸ” Analyze Document", variant="primary")
167
 
168
+ # Replace Textbox with Markdown output
169
+ output = gr.Markdown(
170
  label="Analysis Results",
171
+ elem_classes=["markdown-output"]
 
 
172
  )
173
 
174
  submit_btn.click(
 
177
  outputs=output
178
  )
179
 
180
+ # Add custom CSS for the markdown output
181
+ css = """
182
+ .markdown-output {
183
+ padding: 20px;
184
+ border-radius: 8px;
185
+ background: #f9fafb;
186
+ border: 1px solid #e5e7eb;
187
+ max-height: 600px;
188
+ overflow-y: auto;
189
+ }
190
+ .markdown-output h2 {
191
+ color: #2563eb;
192
+ margin-top: 1.5em;
193
+ margin-bottom: 0.5em;
194
+ }
195
+ .markdown-output h3 {
196
+ color: #3b82f6;
197
+ margin-top: 1em;
198
+ }
199
+ """
200
+ demo.css = css
201
+
202
  if __name__ == "__main__":
203
  demo.launch()