NaimaAqeel commited on
Commit
be13366
·
verified ·
1 Parent(s): 377f3f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -42,7 +42,8 @@ retriever_tokenizer = AutoTokenizer.from_pretrained(retriever_model_name)
42
 
43
  # Initialize FAISS index using LangChain
44
  embedding_dimension = embedding_model.get_sentence_embedding_dimension()
45
- faiss_index = FAISS(HuggingFaceEmbeddings(embedding_model), dimension=embedding_dimension)
 
46
 
47
  # Load or create FAISS index
48
  index_path = "faiss_index.pkl"
@@ -131,6 +132,3 @@ with gr.Blocks() as demo:
131
  query_button.click(fn=process_and_query, inputs=[query], outputs=query_output)
132
 
133
  demo.launch()
134
-
135
-
136
-
 
42
 
43
  # Initialize FAISS index using LangChain
44
  embedding_dimension = embedding_model.get_sentence_embedding_dimension()
45
+ hf_embeddings = HuggingFaceEmbeddings(model_name='sentence-transformers/all-MiniLM-L6-v2')
46
+ faiss_index = FAISS(embedding_function=hf_embeddings, dimension=embedding_dimension)
47
 
48
  # Load or create FAISS index
49
  index_path = "faiss_index.pkl"
 
132
  query_button.click(fn=process_and_query, inputs=[query], outputs=query_output)
133
 
134
  demo.launch()