Skip to content

Commit 025dcdc

Browse files
authored
fix(transformers/blip2): update blip to v4.50.3 (#1130)
1 parent d7af880 commit 025dcdc

File tree

5 files changed

+1120
-375
lines changed

5 files changed

+1120
-375
lines changed

mindone/transformers/models/auto/configuration_auto.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
("mpt", "MptConfig"),
9292
("starcoder2", "Starcoder2Config"),
9393
("mt5", "MT5Config"),
94+
("opt", "OPTConfig"),
9495
("megatron-bert", "MegatronBertConfig"),
9596
("mixtral", "MixtralConfig"),
9697
("owlvit", "OwlViTConfig"),
@@ -197,6 +198,7 @@
197198
("mobilebert", "MobileBERT"),
198199
("mpt", "MPT"),
199200
("mt5", "MT5"),
201+
("opt", "OPT"),
200202
("megatron-bert", "Megatron-BERT"),
201203
("mistral", "Mistral"),
202204
("mixtral", "Mixtral"),

mindone/transformers/models/auto/modeling_auto.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
("glm", "GlmModel"),
6666
("glpn", "GLPNModel"),
6767
("gpt2", "GPT2Model"),
68+
("opt", "OPTModel"),
6869
("granite", "GraniteModel"),
6970
("granitemoe", "GraniteMoeModel"),
7071
("granitemoeshared", "GraniteMoeSharedModel"),
@@ -204,6 +205,7 @@
204205
("granitemoe", "GraniteMoeForCausalLM"),
205206
("granitemoeshared", "GraniteMoeSharedForCausalLM"),
206207
("llama", "LlamaForCausalLM"),
208+
("opt", "OPTForCausalLM"),
207209
("megatron-bert", "MegatronBertForCausalLM"),
208210
("mistral", "MistralForCausalLM"),
209211
("mpt", "MptForCausalLM"),
@@ -454,6 +456,7 @@
454456
("starcoder2", "Starcoder2ForSequenceClassification"),
455457
("canine", "CanineForSequenceClassification"),
456458
("llama", "LlamaForSequenceClassification"),
459+
("opt", "OPTForSequenceClassification"),
457460
("persimmon", "PersimmonForSequenceClassification"),
458461
("mobilebert", "MobileBertForSequenceClassification"),
459462
("convbert", "ConvBertForSequenceClassification"),
@@ -491,6 +494,7 @@
491494
("mobilebert", "MobileBertForQuestionAnswering"),
492495
("megatron-bert", "MegatronBertForQuestionAnswering"),
493496
("mistral", "MistralForQuestionAnswering"),
497+
("opt", "OPTForQuestionAnswering"),
494498
("qwen2", "Qwen2ForQuestionAnswering"),
495499
("rembert", "RemBertForQuestionAnswering"),
496500
("t5", "T5ForQuestionAnswering"),
@@ -503,7 +507,11 @@
503507
]
504508
)
505509

506-
MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING_NAMES = OrderedDict()
510+
MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING_NAMES = OrderedDict(
511+
[
512+
("blip-2", "Blip2ForConditionalGeneration"),
513+
]
514+
)
507515

508516
MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING_NAMES = OrderedDict(
509517
[
@@ -611,6 +619,7 @@
611619
# Model for Zero Shot Image Classification mapping
612620
("blip", "BlipModel"),
613621
("siglip", "SiglipModel"),
622+
("blip-2", "Blip2ForImageTextRetrieval"),
614623
]
615624
)
616625

mindone/transformers/models/blip_2/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,4 @@
1414
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
17-
from .modeling_blip_2 import (
18-
Blip2ForConditionalGeneration,
19-
Blip2Model,
20-
Blip2PreTrainedModel,
21-
Blip2QFormerModel,
22-
Blip2VisionModel,
23-
)
17+
from .modeling_blip_2 import *

0 commit comments

Comments
 (0)