-
Notifications
You must be signed in to change notification settings - Fork 472
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
Support molmo series vlm #2260
Conversation
swift/llm/utils/model.py
Outdated
@@ -690,6 +695,7 @@ class LoRATM(NamedTuple): | |||
] | |||
# compat | |||
llama2 = llama | |||
molmo = 'molmo' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是compat的, 换个位置呗
swift/llm/utils/model.py
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
移动到外面好了
swift/llm/utils/template.py
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional去除
swift/llm/utils/model.py
Outdated
@@ -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'], |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
少了 attention_type 这块 对于flash_attn的支持
跑一下 |
PR type
PR information
Support molmo series vlm