jybae commited on
Commit
2d50a87
1 Parent(s): 1706a2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -23,8 +23,10 @@ if not openai_api_key:
23
  embeddings = OpenAIEmbeddings(openai_api_key=openai_api_key)
24
  #with open("index.pkl", "rb") as f:
25
  # db = faiss.read_index(f.read())
26
- with open("index.pkl", "rb") as f:
27
- db = faiss.deserialize_index(f.read())
 
 
28
 
29
  def get_response_from_query(db, query, k=3):
30
 
 
23
  embeddings = OpenAIEmbeddings(openai_api_key=openai_api_key)
24
  #with open("index.pkl", "rb") as f:
25
  # db = faiss.read_index(f.read())
26
+ #with open("index.pkl", "rb") as f:
27
+ #db = faiss.deserialize_index(f.read())
28
+
29
+ db = FAISS.load_local("index.pkl", embeddings)
30
 
31
  def get_response_from_query(db, query, k=3):
32