From e9a7d7c7851681656d1907153111dee702e8b959 Mon Sep 17 00:00:00 2001 From: Cemal Emre Albayrak <70805503+emre570@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:27:06 +0300 Subject: [PATCH] summarize_video main function --- yt_summarizer.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/yt_summarizer.py b/yt_summarizer.py index 78feaba..6b98640 100644 --- a/yt_summarizer.py +++ b/yt_summarizer.py @@ -28,13 +28,14 @@ def yt_summarization_chain(): summarize_chain = load_summarize_chain(llm=llm, chain_type="refine", verbose=True) return summarize_chain -if __name__ == "__main__": - videos = ["https://www.youtube.com/watch?v=bYjQ9fzinT8", "https://www.youtube.com/watch?v=QCg0axyXxs4"] - - transcript = get_transcript(videos[0]) +def summarize_video(video_link): + transcript = get_transcript(video_link) chunks = split_chunks(transcript) sum_chain = yt_summarization_chain() result = sum_chain.run(chunks) - - print(result) \ No newline at end of file + + return result + +if __name__ == "__main__": + #summarize_video() \ No newline at end of file