Summarize YouTube videos
- Input how many days' worth of videos (N) you want to summarize.
- Input which channel C to summarize.
- Download N days of video audio from channel C.
- Detect language and perform text-to-speech on those videos.
- Generate multiple summaries:
- A summary for each video
- An overall summary for all videos.
mkdir .venv
python -m venv ./.venv
source .venv/bin/activate
pip install --upgrade pip wheel setuptools
pip install yt-dlp==2024.5.27 flask==3.0.3
pip install transformers==4.41.2 #accelerate==0.31.0
Check which version of CUDA you have (Nvidia GPU):
> nvidia-smi
Sat Jun 22 15:35:33 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 555.99 Driver Version: 555.99 CUDA Version: 12.5 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Driver-Model | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 3060 WDDM | 00000000:06:00.0 On | N/A |
| 0% 50C P8 13W / 170W | 984MiB / 12288MiB | 7% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
However, nvcc --version
fails for me and is not recognized. This indicates that the CUDA 12.5 above is not actually accessible.
If you need to swap CUDA versions, follow this guide or the official documentation. The guide seems to assume that you have an alternate version already installed.
I will be installing CUDA 12.1 since it's the latest supported stable version for PyTorch as of June 2024.
Install PyTorch accordingly. For example:
pip3 install torch --index-url https://download.pytorch.org/whl/cu121
Follow the setup here to enable access to YouTube's API: https://developers.google.com/youtube/v3/getting-started
Then install the required client library (we can skip the autorization libraries since we're accessing public information):
pip install --upgrade google-api-python-client