Update app.py
Browse files
app.py
CHANGED
@@ -361,7 +361,7 @@ def txt2chunks(text):
|
|
361 |
return text_splitter.split_text(text)
|
362 |
|
363 |
def vector_store(text_chunks):
|
364 |
-
key = os.getenv('
|
365 |
embeddings = OpenAIEmbeddings(openai_api_key=key)
|
366 |
return FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
367 |
|
@@ -433,7 +433,7 @@ def main():
|
|
433 |
|
434 |
# clip ---
|
435 |
|
436 |
-
openai.api_key = os.getenv('
|
437 |
|
438 |
# File type for output, model choice
|
439 |
menu = ["txt", "htm", "xlsx", "csv", "md", "py"]
|
|
|
361 |
return text_splitter.split_text(text)
|
362 |
|
363 |
def vector_store(text_chunks):
|
364 |
+
key = os.getenv('OPENAI_KEY')
|
365 |
embeddings = OpenAIEmbeddings(openai_api_key=key)
|
366 |
return FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
367 |
|
|
|
433 |
|
434 |
# clip ---
|
435 |
|
436 |
+
openai.api_key = os.getenv('OPENAI_KEY')
|
437 |
|
438 |
# File type for output, model choice
|
439 |
menu = ["txt", "htm", "xlsx", "csv", "md", "py"]
|