Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 115 |
-
.big-
|
| 116 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
""") as demo:
|
| 118 |
gr.Markdown("## π Multilingual Summarizer + Quiz Generator")
|
| 119 |
|
| 120 |
with gr.Accordion("π View README / Usage Guide", open=False):
|
| 121 |
-
gr.Markdown(
|
| 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=
|
| 145 |
-
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
-
|
|
|
|
| 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()
|