GithubHelp home page GithubHelp logo

minigpt4's Introduction

minigpt4

This is a simplified version of MiniGPT-4 that can be used much more easily than the official repo.

Official MiniGPT-4 repo here: https://minigpt-4.github.io/

It's a better starting point for people trying to integrate MiniGPT-4 into their own hobby projects. May require some tweaking to get it to work with your specific use case, but it should be much easier than starting from scratch.

Designed to be integrated into https://github.com/catid/aiwebcam

Setup

This is designed to run on an Ubuntu Linux server with an RTX 4090 installed. Please fork the project or submit a PR to support other platforms.

conda create -n minigpt4 python=3.10

sudo apt install git-lfs

git clone https://github.com/catid/minigpt4
cd minigpt4

git lfs install
git submodule update --init --recursive

conda activate minigpt4
pip install -r requirements.txt

Example Usage

This uses about 18.2 GB of VRAM to run. Note that the first question/answer will be very slow because it is compiling the model. Subsequent questions will be much faster.

Example Image

conda activate minigpt4
(mg4) ➜  minigpt4 git:(main) ✗ CUDA_VISIBLE_DEVICES=0 python example.py

Loading models...
Loading VIT
Loading VIT Done
Loading Q-Former
Loading Q-Former Done
Loading LLAMA

...

Loading image...
Image loaded in 0.03974032402038574 seconds
Live output: <s>I see a large, white missile on the road. It appears to be made of metal and has a pointed nose and tail. It is sitting on the ground, leaning against a road sign. The sign says "Danger: Missile Ahead". There is a cloudy sky in the background.###
LLM response: I see a large, white missile on the road. It appears to be made of metal and has a pointed nose and tail. It is sitting on the ground, leaning against a road sign. The sign says "Danger: Missile Ahead". There is a cloudy sky in the background.
Conversation(system='Human provides a photo and asks questions.  Assistant answers the questions honestly and simply.', roles=('Human', 'Assistant'), messages=[['Human', '<Img><ImageHere></Img> Tell me what you see on the road.'], ['Assistant', 'I see a large, white missile on the road. It appears to be made of metal and has a pointed nose and tail. It is sitting on the ground, leaning against a road sign. The sign says "Danger: Missile Ahead". There is a cloudy sky in the background.']], offset=2, sep_style=<SeparatorStyle.SINGLE: 1>, sep='###', sep2=None, skip_next=False, conv_id=None)
Generated LLM response in 5.6917641162872314 seconds

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.