Coder Social home page Coder Social logo

sudoleg / youtubegpt Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 3.0 731 KB

YouTubeGPT is an LLM-based web-app that allows you to summarize and chat (Q&A) with YouTube videos.

License: MIT License

Python 23.56% Dockerfile 0.34% Jupyter Notebook 76.09%
langchain llms openai python youtube summarizer chat questions-and-answers chatgpt chromadb rag llm

youtubegpt's Introduction

Logo

YouTubeGPT- Your YouTube AI

Features ✨

YouTubeGPT lets you summarize and chat (Q&A) with YouTube videos. Its features include:

  • provide a custom prompt for summaries ✍️ VIEW DEMO
    • you can tailor the summary to your needs by providing a custom prompt or just use the default summarization
  • automatically save summaries 📂
    • the summaries can be automatically saved in the directory where you run the app. The summaries will be available under <YT-channel-name>/<video-title>.md
  • get answers to questions about the video contentVIEW DEMO
    • part of the application is designed and optimized specifically for question answering tasks (Q&A)
  • create your own knowledge base 💾
    • once a video is processed, you can chat with it at any time!
  • choose from different OpenAI models 🤖
    • currently available: gpt-3.5-turbo, gpt-4 (turbo), gpt-4o (mini)
    • by choosing a different model, you can summarize even longer videos and potentially get better responses
  • experiment with settings ⚙️
    • adjust the temperature and top P of the model
  • choose UI theme 🖌️
    • go to the three dots in the upper right corner, select settings and choose either light, dark or my aesthetic custom theme

Installation & usage

No matter how you choose to run the app, you will first need to get an OpenAI API-Key. This is very straightforward and free. Have a look at their instructions to get started.

build & run with Docker (or docker-compose)

  1. make sure to provide an OpenAI API key (l. 43 in docker-compose.yml)
  2. adjust the path to save the summaries (l. 39 in docker-compose.yml)
  3. execute the following command:
# pull from docker hub
docker-compose up -d
# or build locally
docker-compose up --build -d

if you are only interested in summaries

# pull from Docker Hub
docker pull sudoleg/yotube-gpt:latest
# or build locally
docker build --tag=sudoleg/yotube-gpt:latest .
docker run -d -p 8501:8501 \
    -v $(pwd):/app/responses \
    -e OPENAI_API_KEY=<your-openai-api-key> \
    --name youtube-ai sudoleg/yotube-gpt:latest

ℹ️ For the best user-experience, you need to be in Tier 1 usage tier, which requires a one-time payment of 5$. However it's worth it, since then, you'll have access to all models and higher rate limits.

Contributing & Support 🤝

I’m working on adding more features and am open to feedback and contributions. Don't hesitate to create an issue or a pull request. Also, if you are enjoying the app or find it useful, please consider giving the repository a star ⭐

This is a small side-project and it's easy to get started! If you want to contribute, here’s the gist to get your changes rolling:

  1. Fork & clone: Fork the repo and clone your fork to start.
  2. Pick an issue or suggest One: Choose an open issue to work on, or suggest a new feature or bug fix by creating an issue for discussion.
  3. Develop: Make your changes.
    • Ensure your code is clean and documented. Test the changes at least exploratively. Make sure to test 'edge cases'.
    • Commit your changes with clear, descriptive messages, using conventional commits.
  4. Stay updated: Keep your branch in sync with the main branch to avoid merge conflicts.
  5. Pull Request: Push your changes to your fork and submit a pull request (PR) to the main repository. Describe your changes and any relevant details.
  6. Engage: Respond to feedback on your PR to finalize your contribution.

development in virtual environment

# create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate
# install requirements
pip install -r requirements.txt
# you'll need an API key
export OPENAI_API_KEY=<your-openai-api-key>
# run chromadb (necessary for chat)
docker-compose up -d chromadb
# run app
streamlit run main.py

Technologies used

The project is built using some amazing libraries:

License

This project is licensed under the MIT License - see the LICENSE file for details.

youtubegpt's People

Contributors

sudoleg avatar renovate[bot] avatar

Stargazers

 avatar Mark avatar Simon Wessel avatar Jannis Wilms avatar Thorben Theil avatar

Watchers

Kostas Georgiou avatar  avatar

youtubegpt's Issues

implement configuration class

the config class should provide the ability to read config params from a file and adjust them according to the users preference

retrieve completion in json format

to ensure that the model responses in specific format, json-mode can be used. this way i could retrieve the title of the summary and the summary itself as values from two different json keys.

Add transcription feature (separate page)

Most of the transcripts on YouTube are autogenerated. Thus, they contain grammatical errors, filler words, don't have any punctuation and structure. Maybe it can be fixed by using a speech-to-text model like OpenAI's whisper.

error when fetching metadata (title)

Video: https://www.youtube.com/live/BuMZzfDUOf8?si=JnMrM7pVJKexC1C5

Error:

ERROR:root:An unexpected error occurred: 'title'
Traceback (most recent call last):
  File "/app/pages/chat.py", line 214, in <module>
    video_metadata = get_video_metadata(url_input)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/modules/youtube.py", line 61, in get_video_metadata
    filename=f"{json_response['title']}",
                ~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'title'
ERROR:root:An unexpected error occurred 'title'

open sourcing

  • name for the project
  • logo for the project
  • installation/usage instructions
  • #21
  • License?
  • contributing
  • add overview on docker hub
  • add section for known issues and limitations
  • add screenshot or demo video

Check API Key validity only at the start

rn the validity of the api key is checked every time the app/page is refreshed, which happens quite often due to streamlits's architecture. To improve performance, the validity of the api key should be checked only once

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
  • chromadb/chroma 0.5.11
dockerfile
Dockerfile
  • python 3.12.6-slim
github-actions
.github/workflows/docker.yml
  • actions/checkout v4
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/build-push-action v6
.github/workflows/release.yml
  • googleapis/release-please-action v4
.github/workflows/test.yaml
  • actions/checkout v4
  • actions/setup-python v5
  • streamlit/streamlit-app-action v0.0.3
pip_requirements
requirements.txt
  • youtube-transcript-api ==0.6.2
  • langchain-community ==0.2.17
  • langchain-openai ==0.1.25
  • langchain-text-splitters ==0.2.4
  • streamlit ==1.38.0
  • watchdog ==4.0.2
  • pytest ==8.3.3
  • peewee ==3.17.6
  • python-dotenv ==1.0.1
  • chromadb ==0.5.11
  • langchain-chroma ==0.1.4
  • randomname ==0.2.1
  • tiktoken ==0.7.0
  • openai-whisper ==20231117
  • pytubefix ==6.15.4

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.