This project utilizes the lightweight LLM 'Phi-3.5-mini' to summarize YouTube videos. We employ a 4-bit quantized version of the model to optimize performance while maintaining accuracy. The app transcribes audio from YouTube videos using Whisper (or uses existing subtitles if available) and then generates a summary using the Phi-3 model.
- Transcribe YouTube video audio using Whisper
- Use existing subtitles if available
- Summarize transcribed text using Phi-3 model
- User-friendly web interface
Before you begin, ensure you have the following installed:
- Python 3.8+
- Node.js and npm
- Git
git clone https://github.com/....................
- Navigate to this link and download the Phi-3.5-mini-instruct-Q4_K_L.gguf model.
- Create a directory
/Model
in the project root and place the downloaded quantized model inside.
- Download Ollama from here.
- Install Ollama following the provided instructions.
- Copy the downloaded model file into the project directory.
- Create a file named
Modelfile
in the same directory and paste the following content:
FROM Phi-3.5-mini-instruct-Q4_K_L.gguf
SYSTEM You are a helpful AI assistant specialized in summarizing YouTube transcripts.
# Adjust model parameters
PARAMETER temperature 0.7
PARAMETER top_k 40
PARAMETER top_p 0.95
Open a terminal and run the following command:
ollama create quantphi -f Modelfile
pip install -r requirements.txt
- Navigate to the API directory:
cd api
- Start the API:
python api.py
The API should now be running on http://localhost:5000
.
- Navigate to the app directory:
cd app
- Install frontend dependencies:
npm install
- Run the app:
npm run dev
The app should now be accessible at http://localhost:3000
.
- Open your web browser and go to
http://localhost:3000
. - Paste a YouTube video URL into the input field.
- Click the "Summarize" button.
- Wait for the app to process the video and generate a summary.
- Read the generated summary of the YouTube video content.
A demo video showcasing the app's functionality is available below. In the demo, a YouTube video link (https://www.youtube.com/watch?v=NiKtZgImdlY) is pasted into the app, and after a brief processing time, a summary of the video content is generated.
This is the demo video.