Skip to content

Commit

Permalink
Update minigpt-4 readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mzr1996 committed Oct 12, 2023
1 parent 59b105f commit 11abc5b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
7 changes: 4 additions & 3 deletions configs/minigpt4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ For Vicuna model, please refer to [MiniGPT-4 page](https://github.com/Vision-CAI

### Pretrained models

| Model | Params (M) | Flops (G) | Config | Download |
| :------------------------------ | :--------: | :-------: | :--------------------------------------: | :------------------------------------------------------------------------------------------------------------: |
| `minigpt-4_vicuna-7b_caption`\* | 8121.32 | N/A | [config](minigpt-4_vicuna-7b_caption.py) | [model](https://download.openmmlab.com/mmpretrain/v1.0/minigpt4/minigpt-4_linear-projection_20230615-714b5f52.pth) |
| Model | Params (M) | Flops (G) | Config | Download |
| :------------------------------ | :--------: | :-------: | :----------------------------------------: | :----------------------------------------------------------------------------------------------------------: |
| `minigpt-4_baichuan-7b_caption` | 8094.77 | N/A | [config](minigpt-4_baichuan-7b_caption.py) | [model](https://download.openmmlab.com/mmclassification/v1/minigpt4/minigpt-4_linear_baichuan7b_20231011-5dca7ed6.pth) |
| `minigpt-4_vicuna-7b_caption`\* | 8121.32 | N/A | [config](minigpt-4_vicuna-7b_caption.py) | [model](https://download.openmmlab.com/mmclassification/v1/minigpt4/minigpt-4_linear_vicuna7b_20230615-714b5f52.pth) |

*Models with * are converted from the [official repo](https://github.com/Vision-CAIR/MiniGPT-4/tree/main). The config files of these models are only for inference. We haven't reproduce the training results.*

Expand Down
13 changes: 12 additions & 1 deletion configs/minigpt4/metafile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,19 @@ Models:
- Task: Image Caption
Dataset: COCO
Metrics: null
Weights: https://download.openmmlab.com/mmpretrain/v1.0/minigpt4/minigpt-4_linear-projection_20230615-714b5f52.pth
Weights: https://download.openmmlab.com/mmclassification/v1/minigpt4/minigpt-4_linear_vicuna7b_20230615-714b5f52.pth
Config: configs/minigpt4/minigpt-4_vicuna-7b_caption.py
Converted From:
Weights: https://github.com/Vision-CAIR/MiniGPT-4/tree/main
Code: https://github.com/Vision-CAIR/MiniGPT-4/tree/main
- Name: minigpt-4_baichuan-7b_caption
Metadata:
FLOPs: null
Parameters: 8094769024
In Collection: MiniGPT4
Results:
- Task: Image Caption
Dataset: COCO
Metrics: null
Weights: https://download.openmmlab.com/mmclassification/v1/minigpt4/minigpt-4_linear_baichuan7b_20231011-5dca7ed6.pth
Config: configs/minigpt4/minigpt-4_baichuan-7b_caption.py
4 changes: 2 additions & 2 deletions configs/minigpt4/minigpt-4_baichuan-7b_caption.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@
),
lang_encoder=dict(
type='AutoModelForCausalLM',
name_or_path='YOUR_PATH_TO_BAICHUAN',
name_or_path='baichuan-inc/baichuan-7B',
trust_remote_code=True),
tokenizer=dict(
type='AutoTokenizer',
name_or_path='YOUR_PATH_TO_BAICHUAN',
name_or_path='baichuan-inc/baichuan-7B',
trust_remote_code=True),
task='caption',
prompt_template=dict([('en', '###Ask: {} ###Answer: '),
Expand Down
2 changes: 1 addition & 1 deletion projects/gradio_demo/minigpt4_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_free_device():
device = get_free_device()
inferencer = ImageCaptionInferencer(model=args.cfg, pretrained=args.ckpt)
model = inferencer.model
chat = Chat(inferencer, device=device, is_half=True)
chat = Chat(inferencer, device=device, is_half=(device.type != 'cpu'))


def reset(chat_state, img_list):
Expand Down

0 comments on commit 11abc5b

Please sign in to comment.