Spaces:
Running
Running
File size: 747 Bytes
9dc99bc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import streamlit as st
import ollama
from utils.QA_Bot import QA_Bot
from utils.PDF_Reader import PDF_4_QA
ollama.pull("llama3.1")
# Streamlit app
def main():
st.sidebar.title("Upload PDF")
st.sidebar.write("Download Demo PDF file from Below....")
with open("Demo_Document/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()
|