Muzammil6376 commited on
Commit
6b26092
Β·
verified Β·
1 Parent(s): ed57782

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -114,15 +114,14 @@ def process_pdf(pdf_file):
114
  combined_texts = chunks + caps
115
  combined_vectors = tvecs[:text_count] + ivecs
116
 
117
- index = # Build FAISS index from precomputed multimodal vectors:
118
- # (swap order: first embeddings, then texts)
119
- index = FAISS.from_embeddings(
120
- combined_vectors,
121
- combined_texts
122
- )
123
  retriever = index.as_retriever(search_kwargs={"k":2})
124
  status = f"βœ… Indexed '{current_pdf_name}' β€” {len(chunks)} text chunks + {len(imgs)} images"
125
- return current_pdf_name, status, gr.update(interactive=True)
126
 
127
 
128
  def ask_question(pdf_name,question):
 
114
  combined_texts = chunks + caps
115
  combined_vectors = tvecs[:text_count] + ivecs
116
 
117
+ # Build FAISS index from precomputed multimodal vectors:
118
+ index = FAISS.from_embeddings(
119
+ combined_vectors,
120
+ combined_texts,
121
+ )
 
122
  retriever = index.as_retriever(search_kwargs={"k":2})
123
  status = f"βœ… Indexed '{current_pdf_name}' β€” {len(chunks)} text chunks + {len(imgs)} images"
124
+ return current_pdf_name, status, gr.update(interactive=True)interactive=True)
125
 
126
 
127
  def ask_question(pdf_name,question):