Skip to content

Commit 446ede2

Browse files
committed
add checkpoint for vicuna 7b
1 parent 6daf123 commit 446ede2

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

PrepareVicuna.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22
Vicuna is an open-source LLAMA-based LLM that has a performance close to ChatGPT.
33
We currently use the v0 version of Vicuna-13B.
44

5-
To prepare Vicuna’s weight, first download Vicuna’s **delta** weight from [https://huggingface.co/lmsys/vicuna-13b-delta-v0](https://huggingface.co/lmsys/vicuna-13b-delta-v0). In case you have git-lfs installed (https://git-lfs.com), this can be done by
5+
To prepare Vicuna’s weight, first download Vicuna’s **delta** weight from [https://huggingface.co/lmsys/vicuna-13b-delta-v0](https://huggingface.co/lmsys/vicuna-13b-delta-v0).
6+
In case you have git-lfs installed (https://git-lfs.com), this can be done by
67

78
```
89
git lfs install
9-
git clone https://huggingface.co/lmsys/vicuna-13b-delta-v0
10+
git clone https://huggingface.co/lmsys/vicuna-13b-delta-v0 # more powerful, need at least 24G gpu memory
11+
# or
12+
git clone https://huggingface.co/lmsys/vicuna-7b-delta-v0 # smaller, need 12G gpu memory
1013
```
1114

1215
Note that this is not directly the working weight, but the difference between the working weight and the original weight of LLAMA-13B. (Due to LLAMA’s rules, we cannot distribute the weight of LLAMA.)
1316

14-
Then, you need to obtain the original LLAMA-13B weights in the HuggingFace format either following the instruction provided by HuggingFace [here](https://huggingface.co/docs/transformers/main/model_doc/llama) or from the Internet.
17+
Then, you need to obtain the original LLAMA-7B or LLAMA-13B weights in the HuggingFace format
18+
either following the instruction provided by HuggingFace
19+
[here](https://huggingface.co/docs/transformers/main/model_doc/llama) or from the Internet.
1520

1621
When these two weights are ready, we can use tools from Vicuna’s team to create the real working weight.
1722
First, Install their library that is compatible with v0 Vicuna by
@@ -23,7 +28,7 @@ pip install git+https://github.com/lm-sys/[email protected]
2328
Then, run the following command to create the final working weight
2429

2530
```
26-
python -m fastchat.model.apply_delta --base /path/to/llama-13b-hf/ --target /path/to/save/working/vicuna/weight/ --delta /path/to/vicuna-13b-delta-v0/
31+
python -m fastchat.model.apply_delta --base /path/to/llama-13bOR7b-hf/ --target /path/to/save/working/vicuna/weight/ --delta /path/to/vicuna-13bOR7b-delta-v0/
2732
```
2833

2934
Now you are good to go!

README.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,13 @@ Then, set the path to the vicuna weight in the model config file
6969

7070
**3. Prepare the pretrained MiniGPT-4 checkpoint**
7171

72-
To play with our pretrained model, download the pretrained checkpoint
73-
[here](https://drive.google.com/file/d/1a4zLvaiDBr-36pasffmgpvH5P7CKmpze/view?usp=share_link).
72+
Download the pretrained checkpoints according to the Vicuna model you prepare.
73+
74+
| Checkpoint Aligned with Vicuna 13B | Checkpoint Aligned with Vicuna 7B |
75+
:------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------:
76+
[Downlad](https://drive.google.com/file/d/1a4zLvaiDBr-36pasffmgpvH5P7CKmpze/view?usp=share_link) | [Download](https://drive.google.com/file/d/1RY9jV0dyqLX-o38LrumkKRh6Jtaop58R/view?usp=sharing)
77+
78+
7479
Then, set the path to the pretrained checkpoint in the evaluation config file
7580
in [eval_configs/minigpt4_eval.yaml](eval_configs/minigpt4_eval.yaml#L10) at Line 11.
7681

@@ -84,10 +89,9 @@ Try out our demo [demo.py](demo.py) on your local machine by running
8489
python demo.py --cfg-path eval_configs/minigpt4_eval.yaml --gpu-id 0
8590
```
8691

87-
Here, we load Vicuna as 8 bit by default to save some GPU memory usage.
88-
Besides, the default beam search width is 1.
89-
Under this setting, the demo cost about 23G GPU memory.
90-
If you have a more powerful GPU with larger GPU memory, you can run the model
92+
To save GPU memory, Vicuna loads as 8 bit by default, with a beam search width of 1.
93+
This configuration requires about 23G GPU memory for Vicuna 13B and 11.5G GPU memory for Vicuna 7B.
94+
For more powerful GPUs, you can run the model
9195
in 16 bit by setting low_resource to False in the config file
9296
[minigpt4_eval.yaml](eval_configs/minigpt4_eval.yaml) and use a larger beam search width.
9397

0 commit comments

Comments
 (0)