Spaces:
Configuration error
Configuration error
Refactor
Browse files
app.py
CHANGED
@@ -30,6 +30,7 @@ def get_youtube_details(video_url):
|
|
30 |
print(video_url)
|
31 |
loader = YoutubeLoader.from_youtube_url(str(video_url), add_video_info=False)
|
32 |
docs = loader.load()
|
|
|
33 |
print("Video transcripts loaded in DB")
|
34 |
return docs, loader
|
35 |
|
@@ -51,9 +52,10 @@ def bot_message(history, docs):
|
|
51 |
if docs is None:
|
52 |
return history
|
53 |
|
|
|
54 |
user_question = history[-1][0]
|
55 |
splits = text_splitter.split_documents(docs)
|
56 |
-
print(splits)
|
57 |
vectorstore = Chroma.from_documents(documents=splits, embedding=CohereEmbeddings(model="embed-english-light-v3.0",
|
58 |
cohere_api_key=COHERE_API_KEY))
|
59 |
retriever = vectorstore.as_retriever()
|
|
|
30 |
print(video_url)
|
31 |
loader = YoutubeLoader.from_youtube_url(str(video_url), add_video_info=False)
|
32 |
docs = loader.load()
|
33 |
+
print(docs)
|
34 |
print("Video transcripts loaded in DB")
|
35 |
return docs, loader
|
36 |
|
|
|
52 |
if docs is None:
|
53 |
return history
|
54 |
|
55 |
+
print(docs,"instide bot_message")
|
56 |
user_question = history[-1][0]
|
57 |
splits = text_splitter.split_documents(docs)
|
58 |
+
print(splits,"splits are also here")
|
59 |
vectorstore = Chroma.from_documents(documents=splits, embedding=CohereEmbeddings(model="embed-english-light-v3.0",
|
60 |
cohere_api_key=COHERE_API_KEY))
|
61 |
retriever = vectorstore.as_retriever()
|