Giter VIP home page Giter VIP logo

chat-with-youtube's Introduction

Chat with YouTube

Introducing Chat with YouTube, a browser extension that lets you chat with YouTube videos! This is a small project that demonstrates how easy it is to build conversational browser extensions using Hugging Face Inference Endpoints and the Vercel AI SDK.

Demo Application

Since the license is MIT, feel free to fork the project, make improvements, and release it yourself on the Chrome/Firefox Web Store!

Running Locally

We recommend opening up two terminal windows side-by-side, one for the server and one for the extension.

  1. Clone the repository

    git clone https://github.com/xenova/chat-with-youtube.git
  2. Set up the server

    1. Switch to the server directory:

      cd server
    2. Install the necessary dependencies:

      npm install
    3. Create a file .env.local with your Hugging Face Access Token and Inference Endpoint URL. See .env.local.example for an example. If you haven't got these yet, this guide will help you get started.

      HUGGINGFACE_API_KEY=hf_xxx
      HUGGINGFACE_INFERENCE_ENDPOINT_URL=https://YOUR_ENDPOINT.endpoints.huggingface.cloud
    4. Start the server:

      npm run dev
  3. Set up the extension

    1. Switch to the extension folder:

      cd extension
    2. Install the necessary dependencies:

      npm install 
    3. Build the project:

      npm run build 
    4. Add the extension to your browser. To do this, go to chrome://extensions/, enable developer mode (top right), and click "Load unpacked". Select the build directory from the dialog which appears and click "Select Folder".

    5. That's it! You should now be able to open the extenion's popup and use the model in your browser!

How does it work?

Well, it's quite simple actually: just add the transcript and video metadata to the prompt for additional context. For this demo, we use Llama-2-7b-hf, which has a context length of 4096 tokens, and can easily handle most videos. Of course, for longer videos, it would be best to implement segmentation and retrieval augmented generation, but that's beyond the scope of this project.

chat-with-youtube's People

Contributors

xenova 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.