Skip to content

Commit

Permalink
Fix bug from HF path (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
anxiangsir authored Nov 8, 2024
1 parent 610a80e commit 558aa51
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,21 @@ CUDA_VISIBLE_DEVICES=0 python infer.py --model_dir DeepGlint-AI/MLCD-Embodied-7B
# >> Assistant: 这是一幅充满创意的猫头艺术作品。它采用了多色渐变和抽象风格,将猫的头部描绘成一个充满活力和色彩的视觉冲击。猫的眼睛用金色渲染,显得非常有神采,
# 而粉色的鼻子则增添了一丝可爱感。整体设计融合了现代艺术与传统猫头图案,创造出一种既独特又引人入胜的视觉效果。。
```

### Eval
```
pip install lmms-eval==0.2.0
PYTHONPATH=./ CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m accelerate.commands.launch \
--main_process_port=12444 \
--num_processes=8 \
-m lmms_eval \
--model llava \
--model_args pretrained=DeepGlint-AI/MLCD-Embodied-7B,conv_template=qwen_1_5 \
--tasks mme \
--batch_size 1 \
--log_samples \
--log_samples_suffix mlcd \
--output_path ./eval_log/
```



Expand Down
12 changes: 11 additions & 1 deletion docs/MLCD_Embodied.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,17 @@ bash scripts/eval/eval_robo.sh /path/to/your/model
Install the evaluation tool and execute the evaluation script:
```bash
pip install lmms-eval==0.2.0
bash eval.sh
PYTHONPATH=./ CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m accelerate.commands.launch \
--main_process_port=12444 \
--num_processes=8 \
-m lmms_eval \
--model llava \
--model_args pretrained=DeepGlint-AI/MLCD-Embodied-7B,conv_template=qwen_1_5 \
--tasks mme \
--batch_size 1 \
--log_samples \
--log_samples_suffix mlcd \
--output_path ./eval_log/
```


4 changes: 4 additions & 0 deletions llava/model/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def load_pretrained_model(model_path, model_base, model_name, load_8bit=False, l
else:
is_multimodal = False

# FIXME this is a workaround for loading MLCD models from HF Hub
if "MLCD-Embodied" in model_name:
model_name = f"llava_qwen_{model_name}"

if "llava" in model_name.lower() or is_multimodal:
# Load LLaVA model
if "lora" in model_name.lower() and model_base is None:
Expand Down

0 comments on commit 558aa51

Please sign in to comment.