Talip7 commited on
Commit
6bcb91c
Β·
verified Β·
1 Parent(s): a921485

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -15
app.py CHANGED
@@ -111,22 +111,31 @@ def process(text_input, pdf_file, summary_lang, style, char_limit, make_quiz):
111
  return summary
112
 
113
  with gr.Blocks(css="""
114
- .big-file-upload .file-wrap {min-height: 150px !important; max-height: 150px !important;}
115
- .big-textbox textarea {min-height: 150px !important; max-height: 150px !important;}
116
- .small-output textarea {min-height: 150px !important; max-height: 150px !important;}
 
 
 
 
 
 
 
 
 
 
117
  """) as demo:
118
  gr.Markdown("## 🌍 Multilingual Summarizer + Quiz Generator")
119
 
120
  with gr.Accordion("πŸ“˜ View README / Usage Guide", open=False):
121
- gr.Markdown('''This application allows you to upload a PDF or paste text, select your preferred summary language, and receive:
122
-
123
- - βœ‚οΈ A clear summary
124
- - 🏷️ An auto-generated title
125
- - πŸ”‘ 5 relevant keywords
126
- - 🌐 If the content language and summary language differ, the app will auto-translate before summarizing
127
-
128
  Powered by OpenAI GPT-3.5 and Gradio.
129
- ''')
130
 
131
  with gr.Row():
132
  summary_lang = gr.Dropdown(LANGUAGES, value="English", label="Summary Language")
@@ -141,8 +150,13 @@ Powered by OpenAI GPT-3.5 and Gradio.
141
  with gr.Column(scale=2):
142
  pdf_file = gr.File(label="Or Upload PDF", elem_classes="big-file-upload")
143
 
144
- output = gr.Textbox(label="Output", lines=7, elem_classes="small-output")
145
- btn = gr.Button("Summarize")
146
- btn.click(process, [text_input, pdf_file, summary_lang, summary_style, char_limit, make_quiz], output)
 
 
 
 
 
147
 
148
- demo.launch()
 
111
  return summary
112
 
113
  with gr.Blocks(css="""
114
+ .big-file-upload .file-wrap,
115
+ .big-file-upload .wrap,
116
+ .big-file-upload .upload-box,
117
+ .big-file-upload .dropbox {
118
+ min-height: 210px !important;
119
+ max-height: 210px !important;
120
+ height: 210px !important;
121
+ }
122
+ .big-textbox textarea {
123
+ min-height: 210px !important;
124
+ max-height: 210px !important;
125
+ height: 210px !important;
126
+ }
127
  """) as demo:
128
  gr.Markdown("## 🌍 Multilingual Summarizer + Quiz Generator")
129
 
130
  with gr.Accordion("πŸ“˜ View README / Usage Guide", open=False):
131
+ gr.Markdown("""
132
+ This application allows you to upload a PDF or paste text, select your preferred summary language, and receive:
133
+ - βœ‚οΈ A clear summary
134
+ - 🏷️ An auto-generated title
135
+ - πŸ”‘ 5 relevant keywords
136
+ - 🌐 If the content language and summary language differ, the app will auto-translate before summarizing
 
137
  Powered by OpenAI GPT-3.5 and Gradio.
138
+ """)
139
 
140
  with gr.Row():
141
  summary_lang = gr.Dropdown(LANGUAGES, value="English", label="Summary Language")
 
150
  with gr.Column(scale=2):
151
  pdf_file = gr.File(label="Or Upload PDF", elem_classes="big-file-upload")
152
 
153
+ output = gr.Textbox(label="Output", lines=8)
154
+
155
+ run_btn = gr.Button("Summarize")
156
+
157
+ run_btn.click(
158
+ inputs=[summary_lang, summary_style, char_limit, text_input, pdf_file, make_quiz],
159
+ outputs=output
160
+ )
161
 
162
+ demo.launch()