Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -110,8 +110,13 @@ def process(text_input, pdf_file, summary_lang, style, char_limit, make_quiz):
|
|
| 110 |
return summary + "\n\n" + QUIZ_TITLES[summary_lang] + "\n" + quiz
|
| 111 |
return summary
|
| 112 |
|
| 113 |
-
with gr.Blocks(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
gr.Markdown("## 🌍 Multilingual Summarizer + Quiz Generator")
|
|
|
|
| 115 |
with gr.Accordion("📘 View README / Usage Guide", open=False):
|
| 116 |
gr.Markdown('''This application allows you to upload a PDF or paste text, select your preferred summary language, and receive:
|
| 117 |
|
|
@@ -132,12 +137,11 @@ Powered by OpenAI GPT-3.5 and Gradio.
|
|
| 132 |
|
| 133 |
with gr.Row():
|
| 134 |
with gr.Column(scale=2):
|
| 135 |
-
text_input = gr.Textbox(lines=
|
| 136 |
with gr.Column(scale=2):
|
| 137 |
-
pdf_file = gr.File(
|
| 138 |
|
| 139 |
-
|
| 140 |
-
output = gr.Textbox(label="Output", lines=7)
|
| 141 |
btn = gr.Button("Summarize")
|
| 142 |
btn.click(process, [text_input, pdf_file, summary_lang, summary_style, char_limit, make_quiz], output)
|
| 143 |
|
|
|
|
| 110 |
return summary + "\n\n" + QUIZ_TITLES[summary_lang] + "\n" + quiz
|
| 111 |
return summary
|
| 112 |
|
| 113 |
+
with gr.Blocks(css="""
|
| 114 |
+
.big-file-upload .file-wrap {min-height: 370px; max-height: 370px;}
|
| 115 |
+
.big-textbox textarea {min-height: 370px !important; max-height: 370px !important;}
|
| 116 |
+
.small-output textarea {min-height: 110px !important; max-height: 110px !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 |
|
|
|
|
| 137 |
|
| 138 |
with gr.Row():
|
| 139 |
with gr.Column(scale=2):
|
| 140 |
+
text_input = gr.Textbox(lines=15, label="Text Input", elem_classes="big-textbox")
|
| 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 |
|