epochs-demos commited on
Commit
6811e93
·
1 Parent(s): f6603df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,8 +1,9 @@
1
  import gradio as gr
2
- import base64
3
  from gpt_reader.pdf_reader import PaperReader
4
  from gpt_reader.prompt import BASE_POINTS
5
 
 
6
  class GUI:
7
  def __init__(self):
8
  self.api_key = ""
@@ -19,11 +20,12 @@ class GUI:
19
 
20
 
21
  with gr.Blocks() as demo:
22
-
23
  gr.Markdown(
24
  """
25
  # CHATGPT-PAPER-READER
26
  """)
 
 
27
  pdf_input = gr.File(label="PDF File")
28
  api_input = gr.Textbox(label="OpenAI API Key")
29
  result = gr.Textbox(label="PDF Summary")
@@ -34,7 +36,7 @@ with gr.Blocks() as demo:
34
  ask_button = gr.Button("Ask")
35
  with gr.Accordion("About this project"):
36
  gr.Markdown(
37
- """ Simply upload your document and let our model read it within seconds!""")
38
 
39
  app = GUI()
40
  upload_button.click(fn=app.analyse, inputs=[api_input, pdf_input], outputs=result)
@@ -42,4 +44,4 @@ with gr.Blocks() as demo:
42
 
43
  if __name__ == "__main__":
44
  demo.title = "CHATGPT-PAPER-READER"
45
- demo.launch()
 
1
  import gradio as gr
2
+
3
  from gpt_reader.pdf_reader import PaperReader
4
  from gpt_reader.prompt import BASE_POINTS
5
 
6
+
7
  class GUI:
8
  def __init__(self):
9
  self.api_key = ""
 
20
 
21
 
22
  with gr.Blocks() as demo:
 
23
  gr.Markdown(
24
  """
25
  # CHATGPT-PAPER-READER
26
  """)
27
+
28
+ with gr.Tab("Upload PDF File"):
29
  pdf_input = gr.File(label="PDF File")
30
  api_input = gr.Textbox(label="OpenAI API Key")
31
  result = gr.Textbox(label="PDF Summary")
 
36
  ask_button = gr.Button("Ask")
37
  with gr.Accordion("About this project"):
38
  gr.Markdown(
39
+ """Simply upload your document and let our model read it within seconds!""")
40
 
41
  app = GUI()
42
  upload_button.click(fn=app.analyse, inputs=[api_input, pdf_input], outputs=result)
 
44
 
45
  if __name__ == "__main__":
46
  demo.title = "CHATGPT-PAPER-READER"
47
+ demo.launch() # add "share=True" to share CHATGPT-PAPER-READER app on Internet.