Skip to content

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

@Jintao-Huang
Copy link
Collaborator

]
# 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.

移动到外面好了

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去除

'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