display pdf
Browse files- app.py +11 -1
- helper/utils.py +7 -0
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import math
|
2 |
import os
|
|
|
3 |
|
4 |
import openai
|
5 |
import PyPDF2
|
@@ -64,7 +65,16 @@ with st.sidebar:
|
|
64 |
clear_button = st.sidebar.button("Clear Conversation", key="clear")
|
65 |
|
66 |
# Display pdf
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
|
70 |
# Initialize chat history
|
|
|
1 |
import math
|
2 |
import os
|
3 |
+
from datetime import datetime
|
4 |
|
5 |
import openai
|
6 |
import PyPDF2
|
|
|
65 |
clear_button = st.sidebar.button("Clear Conversation", key="clear")
|
66 |
|
67 |
# Display pdf
|
68 |
+
st.image(uploaded_files)
|
69 |
+
|
70 |
+
# Credit
|
71 |
+
current_year = current_year() # This will print the current year
|
72 |
+
st.markdown(
|
73 |
+
f"""
|
74 |
+
<h6 style='text-align: left;'>Copyright © 2010-{current_year} Present Yiqiao Yin</h6>
|
75 |
+
""",
|
76 |
+
unsafe_allow_html=True,
|
77 |
+
)
|
78 |
|
79 |
|
80 |
# Initialize chat history
|
helper/utils.py
CHANGED
@@ -2,6 +2,7 @@ import os
|
|
2 |
from typing import Any, Dict, List, Tuple, Union
|
3 |
|
4 |
import base64
|
|
|
5 |
import streamlit as st
|
6 |
import numpy as np
|
7 |
import pandas as pd
|
@@ -9,6 +10,12 @@ import PyPDF2
|
|
9 |
from openai import OpenAI
|
10 |
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
def read_and_textify(
|
13 |
files: List[str],
|
14 |
) -> Tuple[List[str], List[str]]:
|
|
|
2 |
from typing import Any, Dict, List, Tuple, Union
|
3 |
|
4 |
import base64
|
5 |
+
from datetime import datetime
|
6 |
import streamlit as st
|
7 |
import numpy as np
|
8 |
import pandas as pd
|
|
|
10 |
from openai import OpenAI
|
11 |
|
12 |
|
13 |
+
# Credit
|
14 |
+
def current_year():
|
15 |
+
now = datetime.now()
|
16 |
+
return now.year
|
17 |
+
|
18 |
+
|
19 |
def read_and_textify(
|
20 |
files: List[str],
|
21 |
) -> Tuple[List[str], List[str]]:
|