Spaces:
Runtime error
Runtime error
JoshuaKelleyDs
commited on
Commit
•
c578b36
1
Parent(s):
f8ae825
Update app.py
Browse files
app.py
CHANGED
@@ -98,11 +98,11 @@ async def start():
|
|
98 |
youtube_link = await cl.AskUserMessage("Please provide the YouTube video link").send() # We can ask the user for input using cl.AskUserMessage().send() which does not affect cl.on_message()
|
99 |
# more on ask user message: https://docs.chainlit.io/api-reference/ask/ask-for-input
|
100 |
await cl.Message(content=f"youtube link: {youtube_link}").send() # display and double check to make sure the link is correct
|
101 |
-
youtube_docs = create_youtube_transcription(youtube_link['content']) # create the youtube transcription
|
102 |
-
split_docs = create_text_splitter(youtube_docs) # split the documents into chunks
|
103 |
vector_db = create_faiss_vector_store(split_docs) # create the vector db
|
104 |
bm25 = create_bm25_retreiver(split_docs) # create the BM25 retreiver
|
105 |
-
ensemble_retriever = create_ensemble_retriever(vector_db, bm25) # create the ensemble retriever
|
106 |
cl.user_session.set("ensemble_retriever", ensemble_retriever) # store the ensemble retriever in the user session for our on message function
|
107 |
transcription = youtube_docs[0].page_content # get the transcription of the first document
|
108 |
await cl.Message(content=f"youtube docs: {transcription}").send() # display the transcription of the first document to show that we have the correct data
|
|
|
98 |
youtube_link = await cl.AskUserMessage("Please provide the YouTube video link").send() # We can ask the user for input using cl.AskUserMessage().send() which does not affect cl.on_message()
|
99 |
# more on ask user message: https://docs.chainlit.io/api-reference/ask/ask-for-input
|
100 |
await cl.Message(content=f"youtube link: {youtube_link}").send() # display and double check to make sure the link is correct
|
101 |
+
youtube_docs = await create_youtube_transcription(youtube_link['content']) # create the youtube transcription
|
102 |
+
split_docs = await create_text_splitter(youtube_docs) # split the documents into chunks
|
103 |
vector_db = create_faiss_vector_store(split_docs) # create the vector db
|
104 |
bm25 = create_bm25_retreiver(split_docs) # create the BM25 retreiver
|
105 |
+
ensemble_retriever = await create_ensemble_retriever(vector_db, bm25) # create the ensemble retriever
|
106 |
cl.user_session.set("ensemble_retriever", ensemble_retriever) # store the ensemble retriever in the user session for our on message function
|
107 |
transcription = youtube_docs[0].page_content # get the transcription of the first document
|
108 |
await cl.Message(content=f"youtube docs: {transcription}").send() # display the transcription of the first document to show that we have the correct data
|