Update app.py
Browse files
app.py
CHANGED
@@ -36,12 +36,12 @@ def create_db_from_video_url(video_url, api_key):
|
|
36 |
transcripts = get_transcript(video_url)
|
37 |
|
38 |
# Convert transcript string into a Document
|
39 |
-
|
40 |
|
41 |
print(transcripts)
|
42 |
# cannot provide this directly to the model so we are splitting the transcripts into small chunks
|
43 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
|
44 |
-
docs = text_splitter.split_documents(
|
45 |
print(docs)
|
46 |
|
47 |
db = FAISS.from_documents(docs, embedding=embeddings)
|
|
|
36 |
transcripts = get_transcript(video_url)
|
37 |
|
38 |
# Convert transcript string into a Document
|
39 |
+
docs = Document(page_content=transcripts)
|
40 |
|
41 |
print(transcripts)
|
42 |
# cannot provide this directly to the model so we are splitting the transcripts into small chunks
|
43 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
|
44 |
+
docs = text_splitter.split_documents(docs)
|
45 |
print(docs)
|
46 |
|
47 |
db = FAISS.from_documents(docs, embedding=embeddings)
|