sahanes commited on
Commit
ed76bd6
·
verified ·
1 Parent(s): 57469fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -19,7 +19,7 @@ from langchain_community.vectorstores.faiss import FAISS
19
  #from langchain.vectorstores import FAISS
20
 
21
 
22
-
23
 
24
  # db = faiss.read_index('index.pkl')
25
  #db = pickle.load('index.pkl')
@@ -27,7 +27,9 @@ from langchain_community.vectorstores.faiss import FAISS
27
  # doc_embedding = pickle.load(pkl)
28
  # db.save_local("faiss_index")
29
 
30
- embeddings = OpenAIEmbeddings()
 
 
31
  db=FAISS.load_local("faiss_index", embeddings,allow_dangerous_deserialization=True)
32
  #-----------------------------------------------------------------------------
33
  def get_response_from_query(db, query, k=3):
 
19
  #from langchain.vectorstores import FAISS
20
 
21
 
22
+ export OPENAI_API_KEY='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'
23
 
24
  # db = faiss.read_index('index.pkl')
25
  #db = pickle.load('index.pkl')
 
27
  # doc_embedding = pickle.load(pkl)
28
  # db.save_local("faiss_index")
29
 
30
+ # embeddings = OpenAIEmbeddings()
31
+ OpenAIEmbeddings(openai_api_key=OPENAI_API_KEY)
32
+
33
  db=FAISS.load_local("faiss_index", embeddings,allow_dangerous_deserialization=True)
34
  #-----------------------------------------------------------------------------
35
  def get_response_from_query(db, query, k=3):