Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -98,9 +98,9 @@ if st.button("Get Answer") or (user_question and uploaded_pdf):
|
|
98 |
|
99 |
# Embeddings
|
100 |
embedding_model = SentenceTransformer('all-mpnet-base-v2')
|
101 |
-
all_embeddings = embedding_model.encode(text_chunks) if text_chunks else
|
102 |
|
103 |
-
if
|
104 |
st.error("No text chunks found to create embeddings.")
|
105 |
else:
|
106 |
# Create FAISS index
|
|
|
98 |
|
99 |
# Embeddings
|
100 |
embedding_model = SentenceTransformer('all-mpnet-base-v2')
|
101 |
+
all_embeddings = embedding_model.encode(text_chunks) if text_chunks else None
|
102 |
|
103 |
+
if all_embeddings is None or len(all_embeddings) == 0:
|
104 |
st.error("No text chunks found to create embeddings.")
|
105 |
else:
|
106 |
# Create FAISS index
|