Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -31,16 +31,21 @@ def pdfSummarizer(gemini_api_key, pdf_file, kind):
|
|
31 |
|
32 |
return response.text
|
33 |
|
|
|
|
|
|
|
|
|
34 |
with gr.Blocks(
|
35 |
theme="gstaff/whiteboard",
|
36 |
-
title="PDF Summarizer",
|
37 |
analytics_enabled=True,
|
38 |
fill_height=True
|
39 |
) as app:
|
40 |
gr.HTML("<div style='text-align:center;overflow:hidden;'><h2>PDF Summarizer</h2></div>")
|
41 |
with gr.Sidebar(visible=False):
|
42 |
-
gr.HTML("<div style='text-align:center;overflow:hidden;'><h3
|
43 |
gr.HTML("<br>")
|
|
|
44 |
gr.HTML("<div style='text-align:center;overflow:hidden;'><h4>Gemini API Key</h4></div>")
|
45 |
api_key = gr.Text(label = "",placeholder="Enter your Google Gemini API key here")
|
46 |
|
@@ -56,7 +61,7 @@ with gr.Blocks(
|
|
56 |
with gr.Column():
|
57 |
gr.HTML("<div style='text-align:center;overflow:hidden;'><h2>Summary Output</h2></div>")
|
58 |
out = gr.Markdown()
|
59 |
-
|
60 |
btn.click(fn=pdfSummarizer, inputs=[api_key, pdf_input, summary_type], outputs=out)
|
61 |
clear_btn.click(lambda: [None,None,"5 Bullet Points",""],inputs=None,outputs=[api_key, pdf_input, summary_type, out],queue=False)
|
62 |
|
|
|
31 |
|
32 |
return response.text
|
33 |
|
34 |
+
# define info function
|
35 |
+
def info():
|
36 |
+
gr.Info("Enter your Gemini API key, upload your PDF document, select summary kind, then hit the summarize button")
|
37 |
+
|
38 |
with gr.Blocks(
|
39 |
theme="gstaff/whiteboard",
|
40 |
+
title="📓 PDF Summarizer 📓",
|
41 |
analytics_enabled=True,
|
42 |
fill_height=True
|
43 |
) as app:
|
44 |
gr.HTML("<div style='text-align:center;overflow:hidden;'><h2>PDF Summarizer</h2></div>")
|
45 |
with gr.Sidebar(visible=False):
|
46 |
+
gr.HTML("<div style='text-align:center;overflow:hidden;'><h3>📓 PDF Summarizer 📓</h3></div>")
|
47 |
gr.HTML("<br>")
|
48 |
+
info_btn = gr.Button("Info")
|
49 |
gr.HTML("<div style='text-align:center;overflow:hidden;'><h4>Gemini API Key</h4></div>")
|
50 |
api_key = gr.Text(label = "",placeholder="Enter your Google Gemini API key here")
|
51 |
|
|
|
61 |
with gr.Column():
|
62 |
gr.HTML("<div style='text-align:center;overflow:hidden;'><h2>Summary Output</h2></div>")
|
63 |
out = gr.Markdown()
|
64 |
+
info_btn.click(fn=info)
|
65 |
btn.click(fn=pdfSummarizer, inputs=[api_key, pdf_input, summary_type], outputs=out)
|
66 |
clear_btn.click(lambda: [None,None,"5 Bullet Points",""],inputs=None,outputs=[api_key, pdf_input, summary_type, out],queue=False)
|
67 |
|