Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support molmo series vlm #2260

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Support molmo series vlm #2260

merged 2 commits into from
Oct 16, 2024

Conversation

mi804
Copy link
Collaborator

@mi804 mi804 commented Oct 16, 2024

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Support molmo series vlm

@@ -690,6 +695,7 @@ class LoRATM(NamedTuple):
]
# compat
llama2 = llama
molmo = 'molmo'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是compat的, 换个位置呗

model, tokenizer = get_model_tokenizer_from_repo(model_dir, torch_dtype, model_kwargs, load_model, **kwargs)
tokenizer.processor = processor
# fix bug for molmoe-1b
from types import MethodType
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移动到外面好了

@@ -7,7 +7,7 @@
from datetime import datetime
from functools import partial, wraps
from types import MethodType
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, TypeVar, Union
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, TypeVar, Union, Optional
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional去除

@@ -6924,7 +7022,11 @@ def get_additional_saved_files(model_type: str) -> List[str]:
'qwen-vl': ['SimSun.ttf'],
'qwen-audio': ['mel_filters.npz'],
'yi-vl': ['vit'],
'minicpm-v-v2_6-chat': ['modeling_navit_siglip.py']
'minicpm-v-v2_6-chat': ['modeling_navit_siglip.py'],
'molmoe-1b': ['modeling_molmoe.py'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

写成循环呗

**kwargs):
from transformers import AutoProcessor
processor = AutoProcessor.from_pretrained(model_dir, trust_remote_code=True)
model, tokenizer = get_model_tokenizer_from_repo(model_dir, torch_dtype, model_kwargs, load_model, **kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

少了 attention_type 这块 对于flash_attn的支持

@Jintao-Huang
Copy link
Collaborator

#2199

#2143

@Jintao-Huang
Copy link
Collaborator

跑一下 python scripts/utils/run_model_info.py, 会更新支持的模型的文档

@mi804 mi804 merged commit fb97bba into modelscope:main Oct 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants