Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,25 +31,6 @@ def pdfSummarizer(gemini_api_key, pdf_file, kind):
|
|
| 31 |
|
| 32 |
return response.text
|
| 33 |
|
| 34 |
-
# define info function
|
| 35 |
-
def info():
|
| 36 |
-
gr.HTML("""
|
| 37 |
-
<head>
|
| 38 |
-
<script src='https://cdn.jsdelivr.net/npm/sweetalert2@11.15.10/dist/sweetalert2.all.min.js'></script>
|
| 39 |
-
<link href='https://cdn.jsdelivr.net/npm/sweetalert2@11.15.10/dist/sweetalert2.min.css' rel='stylesheet'>
|
| 40 |
-
</head>
|
| 41 |
-
|
| 42 |
-
<script>
|
| 43 |
-
function alert() {
|
| 44 |
-
Swal.fire({
|
| 45 |
-
title: "How To Use",
|
| 46 |
-
text: "Enter your Gemini API key, upload PDF document, select summary kind, then hit the summarize button",
|
| 47 |
-
icon: "info"
|
| 48 |
-
});
|
| 49 |
-
};
|
| 50 |
-
</script>
|
| 51 |
-
""")
|
| 52 |
-
|
| 53 |
with gr.Blocks(
|
| 54 |
theme="gstaff/whiteboard",
|
| 55 |
analytics_enabled=True,
|
|
@@ -67,10 +48,10 @@ with gr.Blocks(
|
|
| 67 |
# Button with JS Event
|
| 68 |
gr.HTML("""
|
| 69 |
<button onclick="Swal.fire({
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
Info
|
| 75 |
</button>
|
| 76 |
""")
|
|
@@ -89,7 +70,7 @@ with gr.Blocks(
|
|
| 89 |
with gr.Column():
|
| 90 |
gr.HTML("<div style='text-align:center;overflow:hidden;'><h2>Summary Output</h2></div>")
|
| 91 |
out = gr.Markdown()
|
| 92 |
-
|
| 93 |
btn.click(fn=pdfSummarizer, inputs=[api_key, pdf_input, summary_type], outputs=out)
|
| 94 |
clear_btn.click(lambda: [None,None,"5 Bullet Points",""],inputs=None,outputs=[api_key, pdf_input, summary_type, out],queue=False)
|
| 95 |
|
|
|
|
| 31 |
|
| 32 |
return response.text
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
with gr.Blocks(
|
| 35 |
theme="gstaff/whiteboard",
|
| 36 |
analytics_enabled=True,
|
|
|
|
| 48 |
# Button with JS Event
|
| 49 |
gr.HTML("""
|
| 50 |
<button onclick="Swal.fire({
|
| 51 |
+
title: 'How To Use',
|
| 52 |
+
text: 'Enter your Gemini API key, upload PDF document, select summary kind, then hit the summarize button',
|
| 53 |
+
icon: 'info'});"
|
| 54 |
+
style="padding: 10px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer;">
|
| 55 |
Info
|
| 56 |
</button>
|
| 57 |
""")
|
|
|
|
| 70 |
with gr.Column():
|
| 71 |
gr.HTML("<div style='text-align:center;overflow:hidden;'><h2>Summary Output</h2></div>")
|
| 72 |
out = gr.Markdown()
|
| 73 |
+
|
| 74 |
btn.click(fn=pdfSummarizer, inputs=[api_key, pdf_input, summary_type], outputs=out)
|
| 75 |
clear_btn.click(lambda: [None,None,"5 Bullet Points",""],inputs=None,outputs=[api_key, pdf_input, summary_type, out],queue=False)
|
| 76 |
|