masadonline commited on
Commit
7cbad7a
·
verified ·
1 Parent(s): f1e5d17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 not all_embeddings:
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