Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -123,21 +123,22 @@ with gr.Blocks() as demo:
|
|
| 123 |
Powered by OpenAI GPT-3.5 and Gradio.
|
| 124 |
''')
|
| 125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
with gr.Row():
|
| 127 |
with gr.Column(scale=2):
|
| 128 |
-
text_input = gr.Textbox(label="Text Input"
|
| 129 |
with gr.Column(scale=2):
|
| 130 |
-
pdf_file = gr.File(label="Or Upload PDF"
|
| 131 |
|
| 132 |
-
|
| 133 |
output = gr.Textbox(label="Output", lines=7)
|
|
|
|
|
|
|
| 134 |
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
run_btn.click(
|
| 138 |
-
fn=analyze_input,
|
| 139 |
-
inputs=[summary_lang, summary_style, char_limit, text_input, pdf_file, generate_quiz],
|
| 140 |
-
outputs=output
|
| 141 |
-
)
|
| 142 |
-
|
| 143 |
-
demo.launch()
|
|
|
|
| 123 |
Powered by OpenAI GPT-3.5 and Gradio.
|
| 124 |
''')
|
| 125 |
|
| 126 |
+
with gr.Row():
|
| 127 |
+
summary_lang = gr.Dropdown(LANGUAGES, value="English", label="Summary Language")
|
| 128 |
+
summary_style = gr.Dropdown(SUMMARY_STYLES, value="Academic", label="Summary Style")
|
| 129 |
+
char_limit = gr.Textbox(label="Character Limit", value="300")
|
| 130 |
+
|
| 131 |
+
make_quiz = gr.Checkbox(label="Generate Quiz Questions", value=True)
|
| 132 |
+
|
| 133 |
with gr.Row():
|
| 134 |
with gr.Column(scale=2):
|
| 135 |
+
text_input = gr.Textbox(lines=15, label="Text Input")
|
| 136 |
with gr.Column(scale=2):
|
| 137 |
+
pdf_file = gr.File(label="Or Upload PDF")
|
| 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 |
|
| 144 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|