Spaces:
Running
Running
Deepak7376
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -58,9 +58,17 @@ st.sidebar.write("-----------")
|
|
58 |
|
59 |
uploaded_file = st.sidebar.file_uploader("Upload file", type=["pdf"])
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
@st.cache_resource
|
62 |
-
def initialize_qa_chain(
|
63 |
-
loader = PDFMinerLoader(
|
64 |
documents = loader.load()
|
65 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=500)
|
66 |
splits = text_splitter.split_documents(documents)
|
@@ -103,6 +111,7 @@ if uploaded_file is not None:
|
|
103 |
}
|
104 |
os.makedirs("docs", exist_ok=True)
|
105 |
filepath = os.path.join("docs", uploaded_file.name)
|
|
|
106 |
with st.spinner('Embeddings are in process...'):
|
107 |
qa_chain = initialize_qa_chain(filepath, selected_model)
|
108 |
else:
|
|
|
58 |
|
59 |
uploaded_file = st.sidebar.file_uploader("Upload file", type=["pdf"])
|
60 |
|
61 |
+
st.sidebar.write("-----------")
|
62 |
+
st.sidebar.write("About Me")
|
63 |
+
st.sidebar.write("Name: Deepak Yadav")
|
64 |
+
st.sidebar.write("Bio: Passionate about AI and machine learning. Enjoys working on innovative projects and sharing knowledge with the community.")
|
65 |
+
st.sidebar.write("[GitHub](https://github.com//deepak7376)")
|
66 |
+
st.sidebar.write("[LinkedIn](https://www.linkedin.com/in/dky7376)")
|
67 |
+
st.sidebar.write("-----------")
|
68 |
+
|
69 |
@st.cache_resource
|
70 |
+
def initialize_qa_chain(FILEPATH, CHECKPOINT):
|
71 |
+
loader = PDFMinerLoader(FILEPATH)
|
72 |
documents = loader.load()
|
73 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=500)
|
74 |
splits = text_splitter.split_documents(documents)
|
|
|
111 |
}
|
112 |
os.makedirs("docs", exist_ok=True)
|
113 |
filepath = os.path.join("docs", uploaded_file.name)
|
114 |
+
print(filepath)
|
115 |
with st.spinner('Embeddings are in process...'):
|
116 |
qa_chain = initialize_qa_chain(filepath, selected_model)
|
117 |
else:
|