epochs-demos commited on
Commit
93bdb59
·
1 Parent(s): 78c5d05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -1
app.py CHANGED
@@ -3,10 +3,43 @@ import base64
3
  from gpt_reader.pdf_reader import PaperReader
4
  from gpt_reader.prompt import BASE_POINTS
5
 
 
 
 
6
  with open("./logo.png", "rb") as f:
7
  image_data = f.read()
8
  image_base64 = base64.b64encode(image_data).decode("utf-8")
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  class GUI:
11
  def __init__(self):
12
  self.api_key = ""
@@ -23,7 +56,7 @@ class GUI:
23
 
24
 
25
  with gr.Blocks() as demo:
26
- gr.Image(source=image_base64, label="Logo") # Display the logo image
27
 
28
  with gr.Tab("Upload PDF File"):
29
  pdf_input = gr.File(label="PDF File")
 
3
  from gpt_reader.pdf_reader import PaperReader
4
  from gpt_reader.prompt import BASE_POINTS
5
 
6
+ import base64
7
+ import streamlit as st
8
+
9
  with open("./logo.png", "rb") as f:
10
  image_data = f.read()
11
  image_base64 = base64.b64encode(image_data).decode("utf-8")
12
 
13
+ # Define the custom CSS styles
14
+ header_css = """
15
+ <style>
16
+ .header img {
17
+ margin-right: 10px;
18
+ width: 80px;
19
+ height: 50px;
20
+ }
21
+
22
+ .header p {
23
+ font-size: 14px;
24
+ }
25
+ </style>
26
+ """
27
+
28
+ # Render the custom CSS
29
+ st.markdown(header_css, unsafe_allow_html=True)
30
+
31
+ # Render the header
32
+ header_html = f"""
33
+ <div class="header">
34
+ <img src='data:image/png;base64,{image_base64}' alt="Logo"/>
35
+ <p>Disclaimer: This web app is for demonstration purposes only and not intended for commercial use. Contact: [email protected] for full solution.</p>
36
+ </div>
37
+ """
38
+
39
+ # Render the header HTML
40
+ st.markdown(header_html, unsafe_allow_html=True)
41
+
42
+
43
  class GUI:
44
  def __init__(self):
45
  self.api_key = ""
 
56
 
57
 
58
  with gr.Blocks() as demo:
59
+
60
 
61
  with gr.Tab("Upload PDF File"):
62
  pdf_input = gr.File(label="PDF File")