Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -145,7 +145,7 @@ def query_vector_db(query, vector_db):
|
|
145 |
return chat_completion.choices[0].message.content
|
146 |
|
147 |
# Streamlit app
|
148 |
-
st.title("
|
149 |
|
150 |
# Upload PDF
|
151 |
uploaded_file = st.file_uploader("Upload a PDF document", type=["pdf"])
|
@@ -157,15 +157,15 @@ if uploaded_file:
|
|
157 |
|
158 |
# Extract text
|
159 |
text = extract_text_from_pdf(pdf_path)
|
160 |
-
st.write("PDF Text Extracted Successfully!")
|
161 |
|
162 |
# Chunk text
|
163 |
chunks = chunk_text(text)
|
164 |
-
st.write("Text Chunked Successfully!")
|
165 |
|
166 |
# Generate embeddings and store in FAISS
|
167 |
vector_db = create_embeddings_and_store(chunks)
|
168 |
-
st.write("Embeddings Generated and Stored Successfully!")
|
169 |
|
170 |
# Interactive chat section
|
171 |
st.write("### Interactive Chat Section")
|
|
|
145 |
return chat_completion.choices[0].message.content
|
146 |
|
147 |
# Streamlit app
|
148 |
+
st.title("Pdf reading AI Application")
|
149 |
|
150 |
# Upload PDF
|
151 |
uploaded_file = st.file_uploader("Upload a PDF document", type=["pdf"])
|
|
|
157 |
|
158 |
# Extract text
|
159 |
text = extract_text_from_pdf(pdf_path)
|
160 |
+
# st.write("PDF Text Extracted Successfully!")
|
161 |
|
162 |
# Chunk text
|
163 |
chunks = chunk_text(text)
|
164 |
+
# st.write("Text Chunked Successfully!")
|
165 |
|
166 |
# Generate embeddings and store in FAISS
|
167 |
vector_db = create_embeddings_and_store(chunks)
|
168 |
+
# st.write("Embeddings Generated and Stored Successfully!")
|
169 |
|
170 |
# Interactive chat section
|
171 |
st.write("### Interactive Chat Section")
|