This repo was updated in December 2024, but originally it contains materials that were discussed in "Beginner to Master Ollama & Build a YouTube Summarizer with Llama 3 and LangChain".
This repo will teach you how to:
- Use LLM local or API via Ollama and again via LangChain
- Use Llama models (Llama 3l2-3B as of Dec 2024)
- Build UI with Gradio
- Use case = "Summarize YouTube"
- Summarizatin using LangChain's map-reduce approach.
- [added] Customize prompts during the map and combine steps.
Specifically, we will first retrieve a transcript of the target YouTube video (directed via a URL), then we will as the Llama model to summarize it.
- Create conda environment with python=3.12
- Install these modules
pip install gradio openai langchain langchain-community youtube_transcript_api tiktoken transformers langchain-ollama
- Serve Ollama if it's not run already:
ollama serve
If you don't know how, consult my how-to video or Ollama directly.
- Simply run:
python main.py
Ollama
to run local LLM APILlama 3.2-3B
from Meta, to use as AI brain. See on Ollama page.Gradio
, to build UILangChain
as framework for LLM apptiktoken
library to estimate token counts
Feel free to copy and distribute, but we appreciate you giving us credits.
👍 Like | 🔗 Share | 📢 Subscribe | 💬 Comments | ❓ Questions