Spaces:
Running
Running
| import streamlit as st | |
| from QA_Bot import QA_Bot | |
| from PDF_Reader import PDF_4_QA | |
| from PIL import Image | |
| # Streamlit app | |
| def main(): | |
| # Page icon | |
| icon = Image.open('td-logo.png') | |
| # Page config | |
| st.set_page_config(page_title="Q&A ChatBot", | |
| page_icon=icon, | |
| layout="wide" | |
| ) | |
| company_logo_path = 'td-logo.png' | |
| st.sidebar.image(company_logo_path, width=50) | |
| st.sidebar.title("Upload PDF") | |
| st.sidebar.write("Download Demo PDF file from Below....") | |
| with open("Kia_EV6.pdf", "rb") as file: | |
| btn = st.sidebar.download_button( | |
| label="Download PDF", | |
| data=file, | |
| file_name="Kia_EV6.pdf" | |
| ) | |
| uploaded_file = st.sidebar.file_uploader("Choose a PDF file", type="pdf") | |
| if uploaded_file is not None: | |
| st.sidebar.success("File uploaded successfully.") | |
| vector_store = PDF_4_QA(uploaded_file) | |
| QA_Bot(vector_store) | |
| if __name__ == '__main__': | |
| main() | |