nurindahpratiwi
commited on
Commit
β’
9d27aab
1
Parent(s):
da929ea
fix line
Browse files
app.py
CHANGED
@@ -14,40 +14,19 @@ api_key = st.secrets['api_key']
|
|
14 |
def main():
|
15 |
load_dotenv()
|
16 |
st.set_page_config(page_title="PDF Chatbot", page_icon="π")
|
17 |
-
|
18 |
-
<div class="banner">
|
19 |
-
<img src="https://huggingface.co/spaces/wiwaaw/summary/resolve/main/banner.png" alt="Banner Image">
|
20 |
-
</div>
|
21 |
-
<style>
|
22 |
-
.banner {
|
23 |
-
width: 160%;
|
24 |
-
height: 200px;
|
25 |
-
overflow: hidden;
|
26 |
-
}
|
27 |
-
.banner img {
|
28 |
-
width: 100%;
|
29 |
-
object-fit: cover;
|
30 |
-
}
|
31 |
-
</style>
|
32 |
-
"""
|
33 |
-
st.components.v1.html(custom_html)
|
34 |
-
st.write(css, unsafe_allow_html=True)
|
35 |
|
36 |
if "conversation" not in st.session_state:
|
37 |
st.session_state.conversation = None
|
38 |
if "chat_history" not in st.session_state:
|
39 |
st.session_state.chat_history = None
|
40 |
|
41 |
-
st.header("Chat with your PDFs")
|
42 |
user_question = st.text_input("Ask a question about your documents:")
|
43 |
if user_question:
|
44 |
handle_userinput(user_question)
|
45 |
|
46 |
with st.sidebar:
|
47 |
-
st.sidebar.info("""Note: I haven't used any GPU for this project so It can take
|
48 |
-
long time to process large PDFs. Also this is POC project and can be easily upgraded
|
49 |
-
with better model and resources. """)
|
50 |
-
|
51 |
st.subheader("Your PDFs")
|
52 |
pdf_docs = st.file_uploader(
|
53 |
"Upload your PDFs here", accept_multiple_files=True
|
|
|
14 |
def main():
|
15 |
load_dotenv()
|
16 |
st.set_page_config(page_title="PDF Chatbot", page_icon="π")
|
17 |
+
st.image("https://huggingface.co/spaces/wiwaaw/summary/resolve/main/banner.png")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
if "conversation" not in st.session_state:
|
20 |
st.session_state.conversation = None
|
21 |
if "chat_history" not in st.session_state:
|
22 |
st.session_state.chat_history = None
|
23 |
|
24 |
+
st.header("Chat with your PDFs using Language Model")
|
25 |
user_question = st.text_input("Ask a question about your documents:")
|
26 |
if user_question:
|
27 |
handle_userinput(user_question)
|
28 |
|
29 |
with st.sidebar:
|
|
|
|
|
|
|
|
|
30 |
st.subheader("Your PDFs")
|
31 |
pdf_docs = st.file_uploader(
|
32 |
"Upload your PDFs here", accept_multiple_files=True
|