百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

MiniGPT-4

> 编程语言
开源

MiniGPT-4 和 MiniGPT-v2 的开源代码 (https://minigpt-4.GitHub.io, https://minigpt-v2.GitHub.io/)

25.6K stars0 点赞3 次浏览
访问官网GitHub

工具介绍

MiniGPT-4 和 MiniGPT-v2 的开源代码 (https://minigpt-4.GitHub.io, https://minigpt-v2.GitHub.io/)

MiniGPT-V

MiniGPT-v2: Large Language Model as a Unified Interface for Vision-Language Multi-task Learning

Jun Chen, Deyao Zhu, Xiaoqian Shen, Xiang Li, Zechun Liu, Pengchuan Zhang, Raghuraman Krishnamoorthi, Vikas Chandra, Yunyang Xiong☨, Mohamed Elhoseiny☨

☨equal last author

MiniGPT-4: Enhancing Vision-language Understanding with Advanced Large Language Models

Deyao Zhu*, Jun Chen*, Xiaoqian Shen, Xiang Li, Mohamed Elhoseiny

*equal contribution

King Abdullah University of Science and Technology

💡 Get help - Q&A or Discord 💬

**Example Community Efforts Built on Top of MiniGPT-4 **

  • InstructionGPT-4: A 200-Instruction Paradigm for Fine-Tuning MiniGPT-4 Lai Wei, Zihao Jiang, Weiran Huang, Lichao Sun, Arxiv, 2023

  • PatFig: Generating Short and Long Captions for Patent Figures.", Aubakirova, Dana, Kim Gerdes, and Lufei Liu, ICCVW, 2023

  • SkinGPT-4: An Interactive Dermatology Diagnostic System with Visual Large Language Model, Juexiao Zhou and Xiaonan He and Liyuan Sun and Jiannan Xu and Xiuying Chen and Yuetan Chu and Longxi Zhou and Xingyu Liao and Bin Zhang and Xin Gao, Arxiv, 2023

  • ArtGPT-4: Artistic Vision-Language Understanding with Adapter-enhanced MiniGPT-4.", Yuan, Zhengqing, Huiwen Xue, Xinyi Wang, Yongming Liu, Zhuanzhe Zhao, and Kun Wang, Arxiv, 2023

News

[Oct.31 2023] We release the evaluation code of our MiniGPT-v2.

[Oct.24 2023] We release the finetuning code of our MiniGPT-v2.

[Oct.13 2023] Breaking! We release the first major update with our MiniGPT-v2

[Aug.28 2023] We now provide a llama 2 version of MiniGPT-4

Online Demo

Click the image to chat with MiniGPT-v2 around your images Click the image to chat with MiniGPT-4 around your images

MiniGPT-v2 Examples

MiniGPT-4 Examples

More examples can be found in the project page.

Getting Started

Installation

1. Prepare the code and the environment

Git clone our repository, creating a python environment and activate it via the following command

bash
git clone https://github.com/Vision-CAIR/MiniGPT-4.git
cd MiniGPT-4
conda env create -f environment.yml
conda activate minigptv

2. Prepare the pretrained LLM weights

MiniGPT-v2 is based on Llama2 Chat 7B. For MiniGPT-4, we have both Vicuna V0 and Llama 2 version. Download the corresponding LLM weights from the following huggingface space via clone the repository using git-lfs.

Llama 2 Chat 7B Vicuna V0 13B Vicuna V0 7B
Download Downlad Download

Then, set the variable llama_model in the model config file to the LLM weight path.

  • For MiniGPT-v2, set the LLM path here at Line 14.

  • For MiniGPT-4 (Llama2), set the LLM path here at Line 15.

  • For MiniGPT-4 (Vicuna), set the LLM path here at Line 18

3. Prepare the pretrained model checkpoints

Download the pretrained model checkpoints

MiniGPT-v2 (after stage-2) MiniGPT-v2 (after stage-3) MiniGPT-v2 (online developing demo)
Download Download Download

For MiniGPT-v2, set the path to the pretrained checkpoint in the evaluation config file in eval_configs/minigptv2_eval.yaml at Line 8.

MiniGPT-4 (Vicuna 13B) MiniGPT-4 (Vicuna 7B) MiniGPT-4 (LLaMA-2 Chat 7B)
Download Download Download

For MiniGPT-4, set the path to the pretrained checkpoint in the evaluation config file in eval_configs/minigpt4_eval.yaml at Line 8 for Vicuna version or eval_configs/minigpt4_llama2_eval.yaml for LLama2 version.

Launching Demo Locally

For MiniGPT-v2, run

bash
python demo_v2.py --cfg-path eval_configs/minigptv2_eval.yaml  --gpu-id 0

For MiniGPT-4 (Vicuna version), run

bash
python demo.py --cfg-path eval_configs/minigpt4_eval.yaml  --gpu-id 0

For MiniGPT-4 (Llama2 version), run

bash
python demo.py --cfg-path eval_configs/minigpt4_llama2_eval.yaml  --gpu-id 0

To save GPU memory, LLMs loads as 8 bit by default, with a beam search width of 1. This configuration requires about 23G GPU memory for 13B LLM and 11.5G GPU memory for 7B LLM. For more powerful GPUs, you can run the model in 16 bit by setting low_resource to False in the relevant config file:

  • MiniGPT-v2: minigptv2_eval.yaml
  • MiniGPT-4 (Llama2): minigpt4_llama2_eval.yaml
  • MiniGPT-4 (Vicuna): minigpt4_eval.yaml

Thanks @WangRongsheng, you can also run MiniGPT-4 on Colab

Training

For training details of MiniGPT-4, check here.

For finetuning details of MiniGPT-v2, check here

Evaluation

For finetuning details of MiniGPT-v2, check here

Acknowledgement

  • BLIP2 The model architecture of MiniGPT-4 follows BLIP-2. Don't forget to check this great open-source work if you don't know it before!
  • Lavis This repository is built upon Lavis!
  • Vicuna The fantastic language ability of Vicuna with only 13B parameters is just amazing. And it is open-source!
  • LLaMA The strong open-sourced LLaMA 2 language model.

If you're using MiniGPT-4/MiniGPT-v2 in your research or applications, please cite using this BibTeX:

…

License

This repository is under BSD 3-Clause License. Many codes are based on Lavis with BSD 3-Clause License here.

Issues· 375 开放

查看全部 Issues在 GitHub 打开
  • #561

    在使用 MiniGPT-4 (Vicuna-7B) 重现结果时, CHAIR 指标存在显著差异

    更新于 2026年2月23日
  • #542

    训练数据标注文件链接不可用

    更新于 2026年1月26日
  • #516

    region_descriptions.json 文件在哪里?

    更新于 2026年1月26日
  • #560

    https://<用户名-GitHub>.GitHub.io/<存储库名>/

    更新于 2025年11月24日
  • #331

    有没有可以推断的脚本? 不是Gradio演示

    更新于 2025年11月18日
  • #237

    torch.distributed.elastic.multiprocessing.errors.ChildFailedError:

    更新于 2025年10月29日
  • #558

    在没有重新加载模型的情况下,LLaMA 输出嵌入的形状会随着多个图像输入而不断增加

    更新于 2025年7月23日
  • #555

    在微型 GPT-4 的微调过程中,无法打开数据集和检查点链接的情况下,请求帮助

    更新于 2025年5月9日
  • #530

    AssertionError: 没有注册模型 'mini_gpt4'。

    更新于 2025年5月7日
  • #159

    如何使用自己的数据集进行微调?

    更新于 2025年5月7日

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月30日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言