TomassiniDigital commited on
Commit
c9f3dbb
·
verified ·
1 Parent(s): 975d879

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -12,6 +12,7 @@ from renderers import (
12
  render_categorized_report,
13
  )
14
  from utils import extract_pdf_text
 
15
 
16
 
17
  # ---------------------------------------------------------------------------
@@ -143,7 +144,9 @@ with gr.Blocks(
143
  placeholder="Incolla il testo del documento di gara…",
144
  show_label=False,
145
  )
146
- txt_btn = gr.Button("Anonimizza", variant="primary", size="lg")
 
 
147
 
148
  with gr.TabItem("📄 PDF"):
149
  pdf_in = gr.File(label="Carica un PDF", file_types=[".pdf"])
@@ -168,4 +171,6 @@ with gr.Blocks(
168
  txt_btn.click(handle_text, inputs=[txt_in, *inputs_common], outputs=outputs)
169
  pdf_btn.click(handle_pdf, inputs=[pdf_in, *inputs_common], outputs=outputs)
170
 
171
- demo.launch()
 
 
 
12
  render_categorized_report,
13
  )
14
  from utils import extract_pdf_text
15
+ from demo_text import DEMO_TEXT
16
 
17
 
18
  # ---------------------------------------------------------------------------
 
144
  placeholder="Incolla il testo del documento di gara…",
145
  show_label=False,
146
  )
147
+ with gr.Row():
148
+ txt_btn = gr.Button("Anonimizza", variant="primary", size="lg", scale=3)
149
+ demo_btn = gr.Button("📋 Carica esempio", variant="secondary", size="lg", scale=1)
150
 
151
  with gr.TabItem("📄 PDF"):
152
  pdf_in = gr.File(label="Carica un PDF", file_types=[".pdf"])
 
171
  txt_btn.click(handle_text, inputs=[txt_in, *inputs_common], outputs=outputs)
172
  pdf_btn.click(handle_pdf, inputs=[pdf_in, *inputs_common], outputs=outputs)
173
 
174
+ demo_btn.click(lambda: DEMO_TEXT, inputs=None, outputs=txt_in)
175
+
176
+ demo.launch()