Giter Site home page Giter Site logo

benderscript / vidbot Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 51 KB

This program will create a Video RAG Chatbot from a video you upload or a youtube URL.

License: Apache License 2.0

Python 100.00%
chatbot mp3 openai transcribe transcription video

vidbot's Introduction

VidBot

VidBot is a chatbot that lets you ask questions about any video you want. Whether it's a movie, a lecture, or a tutorial, VidBot can help you find the information you need. You can use VidBot with videos stored on your computer or with YouTube links.

It uses the latest OpenAI GPT-4 for transcriptions and chat completions.

Application Flow

The app works as follows:

  • Temp directory is created to store temporary files such as audio and transcriptions
  • The user sends a video to the bot or points to a YouTube URL.
  • The app extracts the audio from the video.
  • The app sends the audio to OpenAI and waits for transcription.
  • The app collates one or more transcriptions from OpenAI into a single transcription.
  • The app sends the transcription to chatGPT 4 for correction.
  • The app splits and inserts the correct transcription into a vectorDB for RAG.
  • Finally, a RAG chatbot is created.

Goals

The goal of this app was to use two different OpenAI services, trancription and completions, for the creation of a video chatbot.

Installation

To install the app, you need to have Python 3 and pip installed on your system. Then, install the dependencies with:

pip3 install -r requirements.txt

Configuration

You should create a .env file in the root directory of the app with the following variables:

OPENAI_API_KEY=<your open ai key>
OPENAI_API_TEMPERATURE=0.6
OPENAI_API_MODEL_NAME=gpt-4

Running

The app is built on top of Streamlit, but I provide a bootstrap file so you can run it simply with:

python3 bootstrap.py

Example URL: Introducing GPT-4

You can stop the application by pressing stop on the sidebar

Lessons leaned

  1. Langchain is poorly documented, lots of trial and error all around, specially to make custom prompts work
  2. If the transcription prompt is in question format or similar, GPT-4 will answer and therefore transcription will be overwritten by that answer. LOL
  3. AzureAI documentation and examples are fantastic
  4. Figuring a way to stop streamlit from within for mult-page app. I ended up using a sidebar page to stop the app.

License

See repository.

vidbot's People

Contributors

benderscript avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.