Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,19 +41,19 @@ with gr.Blocks(
|
|
| 41 |
with gr.Row():
|
| 42 |
|
| 43 |
api_key = gr.Text(label="Gemini API Key", placeholder="Enter your Google Gemini API key here"),
|
| 44 |
-
|
| 45 |
summary_type = gr.Radio(["5 Bullet Points","10 Bullet Points", "Paragraph", "Sentence"],value = "5 Bullet Points", label="Select Summary Kind")
|
| 46 |
|
| 47 |
with gr.Column():
|
| 48 |
with gr.Row():
|
| 49 |
btn = gr.Button("Summarize")
|
| 50 |
-
clear_btn = gr.ClearButton(value="Clear")
|
| 51 |
|
| 52 |
with gr.Column():
|
| 53 |
gr.Markdown("<center><h2>Summary Output</h2></center>")
|
| 54 |
out = gr.Markdown()
|
| 55 |
|
| 56 |
-
btn.click(fn=pdfSummarizer, inputs=[api_key,
|
| 57 |
-
clear_btn.click(lambda: [None,None,"5 Bullet Points",""],inputs=None,outputs=[api_key,
|
| 58 |
|
| 59 |
app.launch()
|
|
|
|
| 41 |
with gr.Row():
|
| 42 |
|
| 43 |
api_key = gr.Text(label="Gemini API Key", placeholder="Enter your Google Gemini API key here"),
|
| 44 |
+
pdf_input = gr.File(file_types=[".pdf"]),
|
| 45 |
summary_type = gr.Radio(["5 Bullet Points","10 Bullet Points", "Paragraph", "Sentence"],value = "5 Bullet Points", label="Select Summary Kind")
|
| 46 |
|
| 47 |
with gr.Column():
|
| 48 |
with gr.Row():
|
| 49 |
btn = gr.Button("Summarize")
|
| 50 |
+
clear_btn = gr.ClearButton(value="Clear",components=[api_key, pdf_input, summary_type])
|
| 51 |
|
| 52 |
with gr.Column():
|
| 53 |
gr.Markdown("<center><h2>Summary Output</h2></center>")
|
| 54 |
out = gr.Markdown()
|
| 55 |
|
| 56 |
+
btn.click(fn=pdfSummarizer, inputs=[api_key, pdf_input, summary_type], outputs=out)
|
| 57 |
+
# clear_btn.click(lambda: [None,None,"5 Bullet Points",""],inputs=None,outputs=[api_key, pdf_input, summary_type, out],queue=False)
|
| 58 |
|
| 59 |
app.launch()
|