bisoye commited on
Commit
9bad7f1
1 Parent(s): 22f0c61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -43
app.py CHANGED
@@ -1,43 +1,45 @@
1
- import gradio as gr
2
- from helper_fns import process_files, get_summarization_method
3
- from summarizer import summarize_files
4
-
5
- with gr.Blocks() as demo:
6
- with gr.Row():
7
- with gr.Column():
8
- files = gr.UploadButton(
9
- label='Upload Files For Summarization',
10
- file_count='multiple',
11
- file_types=["pdf", "docx", "pptx"]
12
- )
13
- summarization_method_radio = gr.Radio(choices=['map_reduce', 'stuff', 'refine'],
14
- value='map_reduce',
15
- label='Select Summarization Method',
16
- interactive=False)
17
-
18
- generate_summaries_button = gr.Button(value='Generate Summaries',
19
- interactive=False,
20
- elem_id='summary_button')
21
-
22
-
23
-
24
- files.upload(process_files, None, outputs=[generate_summaries_button,
25
- summarization_method_radio])
26
- summarization_method_radio.input(fn = get_summarization_method,
27
- inputs=summarization_method_radio)
28
-
29
- with gr.Column():
30
- summary_text = gr.Textbox(label='Summarized Text: ',
31
- interactive=False)
32
-
33
-
34
- generate_summaries_button.click(
35
- fn = summarize_files,
36
- inputs=[summarization_method_radio, files],
37
- outputs=[summary_text]#, audio_file]
38
- )
39
-
40
-
41
-
42
-
43
-
 
 
 
1
+ import gradio as gr
2
+ from helper_fns import process_files, get_summarization_method
3
+ from summarizer import summarize_files
4
+
5
+ with gr.Blocks() as demo:
6
+ with gr.Row():
7
+ with gr.Column():
8
+ files = gr.UploadButton(
9
+ label='Upload Files For Summarization',
10
+ file_count='multiple',
11
+ file_types=["pdf", "docx", "pptx"]
12
+ )
13
+ summarization_method_radio = gr.Radio(choices=['map_reduce', 'stuff', 'refine'],
14
+ value='map_reduce',
15
+ label='Select Summarization Method',
16
+ interactive=False)
17
+
18
+ generate_summaries_button = gr.Button(value='Generate Summaries',
19
+ interactive=False,
20
+ elem_id='summary_button')
21
+
22
+
23
+
24
+ files.upload(process_files, None, outputs=[generate_summaries_button,
25
+ summarization_method_radio])
26
+ summarization_method_radio.input(fn = get_summarization_method,
27
+ inputs=summarization_method_radio)
28
+
29
+ with gr.Column():
30
+ summary_text = gr.Textbox(label='Summarized Text: ',
31
+ interactive=False)
32
+
33
+
34
+ generate_summaries_button.click(
35
+ fn = summarize_files,
36
+ inputs=[summarization_method_radio, files],
37
+ outputs=[summary_text]#, audio_file]
38
+ )
39
+
40
+
41
+
42
+ demo.launch()
43
+
44
+
45
+