Update app.py
Browse files
app.py
CHANGED
@@ -46,21 +46,21 @@ def invoke(openai_api_key, use_rag, prompt):
|
|
46 |
temperature = 0)
|
47 |
if (use_rag):
|
48 |
# Document loading, splitting, and storage
|
49 |
-
loader = GenericLoader(YoutubeAudioLoader([YOUTUBE_URL_1,
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
docs = loader.load()
|
58 |
-
text_splitter = RecursiveCharacterTextSplitter(chunk_overlap = 150,
|
59 |
-
|
60 |
-
splits = text_splitter.split_documents(docs)
|
61 |
-
vector_db = Chroma.from_documents(documents = splits,
|
62 |
-
|
63 |
-
|
64 |
# Document retrieval
|
65 |
vector_db = Chroma(embedding_function = OpenAIEmbeddings(),
|
66 |
persist_directory = CHROMA_DIR)
|
|
|
46 |
temperature = 0)
|
47 |
if (use_rag):
|
48 |
# Document loading, splitting, and storage
|
49 |
+
#loader = GenericLoader(YoutubeAudioLoader([YOUTUBE_URL_1,
|
50 |
+
# YOUTUBE_URL_2,
|
51 |
+
# YOUTUBE_URL_3,
|
52 |
+
# YOUTUBE_URL_4,
|
53 |
+
# YOUTUBE_URL_5,
|
54 |
+
# YOUTUBE_URL_6,
|
55 |
+
# YOUTUBE_URL_7], YOUTUBE_DIR),
|
56 |
+
# OpenAIWhisperParser())
|
57 |
+
#docs = loader.load()
|
58 |
+
#text_splitter = RecursiveCharacterTextSplitter(chunk_overlap = 150,
|
59 |
+
# chunk_size = 1500)
|
60 |
+
#splits = text_splitter.split_documents(docs)
|
61 |
+
#vector_db = Chroma.from_documents(documents = splits,
|
62 |
+
# embedding = OpenAIEmbeddings(),
|
63 |
+
# persist_directory = CHROMA_DIR)
|
64 |
# Document retrieval
|
65 |
vector_db = Chroma(embedding_function = OpenAIEmbeddings(),
|
66 |
persist_directory = CHROMA_DIR)
|