awacke1 commited on
Commit
6514ba2
·
1 Parent(s): dda2299

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -31,7 +31,11 @@ def get_text_chunks(text):
31
 
32
 
33
  def get_vectorstore(text_chunks):
34
- embeddings = OpenAIEmbeddings()
 
 
 
 
35
  # embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-xl")
36
  vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
37
  return vectorstore
 
31
 
32
 
33
  def get_vectorstore(text_chunks):
34
+ #embeddings = OpenAIEmbeddings()
35
+
36
+ key = os.getenv('OPENAI_KEY')
37
+ embeddings = OpenAIEmbeddings(openai_api_key=key)
38
+
39
  # embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-xl")
40
  vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
41
  return vectorstore