Closed HuBocheng closed 1 month ago
For evaluating our merged weghts:
Evaluation for LoRA tuning models
You can use script/merge_lora_weights.py to merge the LoRA weights and base LLM, and then evaluate it as [evaluation_full.md](https://github.com/BAAI-DCAI/Bunny/blob/main/script/eval/full/evaluation_full.md).
then evaluate it as evaluation_full.md
CUDA_VISIBLE_DEVICES=0 sh script/eval/full/mmbench.sh
For merging weights:
You may mkdir
first because both levels of folder don't exist.
I have identified the source of the issue. It occurred because after downloading the unmerged LoRA weights, I renamed the folder to unmerged_Bunny-phi-siglip. However, the merge_lora_weights.py script determines whether to load the LoRA weights based on whether the model name contains the word "lora". Since my folder name did not include "lora", the script mistakenly attempted to load the pretrained weights and searched for the mm_projector.bin file.
if 'lora' in model_name.lower() and model_base is None:
warnings.warn(
'There is `lora` in model name but no `model_base` is provided. If you are loading a LoRA model, please provide the `model_base` argument.')
if 'lora' in model_name.lower() and model_base is not None:
lora_cfg_pretrained = AutoConfig.from_pretrained(model_path)
By including "lora" in the folder name, the script ran successfully as below. I appreciate your understanding and thank you for your patience as I worked through this issue. :thumbsup::smile:
Great!
Close the issue for now if there's no further discussions. Feel free to reopen it if there's any other questions.
I am using the following bash script and command with the mmbench dataset for replication purposes. The model file
./checkpoints-lora-total/merged_Bunny-phi-siglip
was downloaded from this link: BAAI/Bunny-v1_0-3B · Hugging Face.The command used was:
CUDA_VISIBLE_DEVICES=0 sh script/eval/lora/mmbench.sh
The following error occurred:
Subsequently, I attempted to manually merge the lora weights. I downloaded the weights from BAAI/bunny-phi-2-siglip-lora · Hugging Face and saved them as
./checkpoints-lora-total/unmerged_Bunny-phi-siglip
, and ran the following command:However,
I still encountered an error:
I would greatly appreciate your assistance in understanding why these errors are occurring.