Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,11 @@ user_query = read_txt(text_file_path)
|
|
| 22 |
char_text_splitter = CharacterTextSplitter(separator="\n", chunk_size=1000, chunk_overlap=200, length_function=len)
|
| 23 |
text_chunks = char_text_splitter.split_text(user_query)
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
docsearch = FAISS.from_texts(text_chunks, embeddings)
|
| 27 |
|
| 28 |
llm = OpenAI()
|
|
|
|
| 22 |
char_text_splitter = CharacterTextSplitter(separator="\n", chunk_size=1000, chunk_overlap=200, length_function=len)
|
| 23 |
text_chunks = char_text_splitter.split_text(user_query)
|
| 24 |
|
| 25 |
+
|
| 26 |
+
openai_api_key = "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"
|
| 27 |
+
embeddings = OpenAIEmbeddings(openai_api_key=openai_api_key)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
docsearch = FAISS.from_texts(text_chunks, embeddings)
|
| 31 |
|
| 32 |
llm = OpenAI()
|