- 
                Notifications
    You must be signed in to change notification settings 
- Fork 151
[OpenVINO]add support for minicpmv4/4_5 #1412
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
4b70b7f
              7c64417
              4b245f1
              81f69be
              6974a3e
              bd8b41f
              6c0c617
              05fad58
              b4e2ce1
              39223a4
              bd1adbd
              6aec742
              f6d7750
              a96d993
              02a4acf
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -2865,12 +2865,22 @@ def with_behavior( | |
| """ | ||
| if isinstance(behavior, str) and not isinstance(behavior, MiniCPMVConfigBehavior): | ||
| behavior = MiniCPMVConfigBehavior(behavior) | ||
|  | ||
| model_mapping = {2.6: "llama", 4.0: "qwen2", 4.5: "qwen3"} | ||
|          | ||
| if behavior == MiniCPMVConfigBehavior.TEXT_EMBEDDINGS: | ||
| return get_vlm_text_embeddings_config("qwen2", self._orig_config, self.int_dtype, self.float_dtype) | ||
| return get_vlm_text_embeddings_config( | ||
| model_mapping[self._orig_config.version], | ||
| self._orig_config, | ||
| self.int_dtype, | ||
| self.float_dtype, | ||
| ) | ||
|  | ||
| if behavior == MiniCPMVConfigBehavior.LANGUAGE: | ||
| return get_vlm_text_generation_config("qwen2", self._orig_config, self.int_dtype, self.float_dtype) | ||
| return get_vlm_text_generation_config( | ||
| model_mapping[self._orig_config.version], | ||
| self._orig_config, | ||
| self.int_dtype, | ||
| self.float_dtype, | ||
| ) | ||
|  | ||
| if behavior == MiniCPMVConfigBehavior.VISION_EMBEDDINGS: | ||
| return self.__class__( | ||
|  | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -116,6 +116,8 @@ | |
| "minicpm": "katuni4ka/tiny-random-minicpm", | ||
| "minicpm3": "katuni4ka/tiny-random-minicpm3", | ||
| "minicpmv": "katuni4ka/tiny-random-minicpmv-2_6", | ||
| "minicpmv4": "snake7gun/minicpm-v-4-tiny", | ||
| "minicpmv4_5": "snake7gun/tiny-minicpmv-4_5", | ||
|          | ||
| "mistral": "echarlaix/tiny-random-mistral", | ||
| "mistral-nemo": "katuni4ka/tiny-random-mistral-nemo", | ||
| "mixtral": "TitanML/tiny-mixtral", | ||
|  | @@ -284,6 +286,18 @@ | |
| "vision_embeddings_model": 26, | ||
| "resampler_model": 6, | ||
| }, | ||
| "minicpmv4": { | ||
| "lm_model": 30, | ||
| "text_embeddings_model": 1, | ||
| "vision_embeddings_model": 14, | ||
| "resampler_model": 6, | ||
| }, | ||
| "minicpmv4_5": { | ||
| "lm_model": 30, | ||
| "text_embeddings_model": 1, | ||
| "vision_embeddings_model": 14, | ||
| "resampler_model": 6, | ||
| }, | ||
| "llava_next_video": { | ||
| "lm_model": 30, | ||
| "text_embeddings_model": 1, | ||
|  | ||
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.
should use str for versions
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.
may i understand why?the version in model's config is a number:
https://huggingface.co/openbmb/MiniCPM-V-4_5/blob/main/config.json#L3
Uh oh!
There was an error while loading. Please reload this page.
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.
ah okay I see ! thanks for the clarification.
(it's generally a bad idea to use numbers for versions: 4.0 becomes 4 and 4.10 and 4.1 are the same version 😅)