pentarosarium commited on
Commit
f68382f
·
1 Parent(s): b3c07e0
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -645,7 +645,7 @@ def create_interface():
645
  control = ProcessControl()
646
 
647
  with gr.Blocks(theme=gr.themes.Soft()) as app:
648
- gr.Markdown("# AI-анализ мониторинга новостей v.1.36")
649
 
650
  with gr.Row():
651
  file_input = gr.File(
@@ -694,7 +694,12 @@ def create_interface():
694
  sentiment_plot = gr.Plot(label="Распределение тональности")
695
  with gr.Column(scale=1):
696
  events_plot = gr.Plot(label="Распределение событий")
 
697
 
 
 
 
 
698
  def stop_processing():
699
  control.request_stop()
700
  return "Остановка обработки..."
@@ -865,6 +870,12 @@ def create_interface():
865
  ]
866
  )
867
 
 
 
 
 
 
 
868
  return app
869
 
870
  if __name__ == "__main__":
 
645
  control = ProcessControl()
646
 
647
  with gr.Blocks(theme=gr.themes.Soft()) as app:
648
+ gr.Markdown("# AI-анализ мониторинга новостей v.1.37")
649
 
650
  with gr.Row():
651
  file_input = gr.File(
 
694
  sentiment_plot = gr.Plot(label="Распределение тональности")
695
  with gr.Column(scale=1):
696
  events_plot = gr.Plot(label="Распределение событий")
697
+ # Add download button with initial state of invisible
698
 
699
+ download_button = gr.Button("📥 Скачать результаты", visible=False)
700
+ file_output = gr.File(label="Результаты анализа", visible=False)
701
+
702
+
703
  def stop_processing():
704
  control.request_stop()
705
  return "Остановка обработки..."
 
870
  ]
871
  )
872
 
873
+ download_button.click(
874
+ fn=handle_file_download,
875
+ inputs=[file_output],
876
+ outputs=[file_output]
877
+ )
878
+
879
  return app
880
 
881
  if __name__ == "__main__":