Skip to content

Commit e9f9b63

Browse files
committed
add seed_oss model
1 parent 2c574e1 commit e9f9b63

File tree

9 files changed

+689
-2
lines changed

9 files changed

+689
-2
lines changed

mindone/transformers/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,14 @@
12141214
SeamlessM4Tv2Model,
12151215
SeamlessM4Tv2PreTrainedModel,
12161216
)
1217+
from .models.seed_oss import (
1218+
SeedOssForCausalLM,
1219+
SeedOssForQuestionAnswering,
1220+
SeedOssForSequenceClassification,
1221+
SeedOssForTokenClassification,
1222+
SeedOssModel,
1223+
SeedOssPreTrainedModel,
1224+
)
12171225
from .models.segformer import (
12181226
SegformerDecodeHead,
12191227
SegformerForImageClassification,

mindone/transformers/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
sam,
202202
seamless_m4t,
203203
seamless_m4t_v2,
204+
seed_oss,
204205
segformer,
205206
seggpt,
206207
sew,

mindone/transformers/models/auto/configuration_auto.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@
230230
("seamless_m4t", "SeamlessM4TConfig"),
231231
("seamless_m4t_v2", "SeamlessM4Tv2Config"),
232232
("segformer", "SegformerConfig"),
233+
("seed_oss", "SeedOssConfig"),
233234
("seggpt", "SegGptConfig"),
234235
("sew", "SEWConfig"),
235236
("sew-d", "SEWDConfig"),
@@ -499,6 +500,7 @@
499500
("sam", "SAM"),
500501
("seamless_m4t", "SeamlessM4T"),
501502
("seamless_m4t_v2", "SeamlessM4Tv2"),
503+
("seed_oss", "SeedOss"),
502504
("segformer", "SegFormer"),
503505
("seggpt", "SegGPT"),
504506
("sew", "SEW"),

mindone/transformers/models/auto/modeling_auto.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
("sam", "SamModel"),
210210
("seamless_m4t", "SeamlessM4TModel"),
211211
("seamless_m4t_v2", "SeamlessM4Tv2Model"),
212+
("seed_oss", "SeedOssModel"),
212213
("segformer", "SegformerModel"),
213214
("seggpt", "SegGptModel"),
214215
("sew", "SEWModel"),
@@ -486,6 +487,7 @@
486487
("roc_bert", "RoCBertForCausalLM"),
487488
("roberta", "RobertaForCausalLM"),
488489
("rwkv", "RwkvForCausalLM"),
490+
("seed_oss", "SeedOssForCausalLM"),
489491
("stablelm", "StableLmForCausalLM"),
490492
("starcoder2", "Starcoder2ForCausalLM"),
491493
("trocr", "TrOCRForCausalLM"),
@@ -915,6 +917,7 @@
915917
("roc_bert", "RoCBertForSequenceClassification"),
916918
("roberta", "RobertaForSequenceClassification"),
917919
("roberta-prelayernorm", "RobertaPreLayerNormForSequenceClassification"),
920+
("seed_oss", "SeedOssForSequenceClassification"),
918921
("stablelm", "StableLmForSequenceClassification"),
919922
("starcoder2", "Starcoder2ForSequenceClassification"),
920923
("t5", "T5ForSequenceClassification"),
@@ -978,6 +981,7 @@
978981
("roc_bert", "RoCBertForQuestionAnswering"),
979982
("roberta", "RobertaForQuestionAnswering"),
980983
("roberta-prelayernorm", "RobertaPreLayerNormForQuestionAnswering"),
984+
("seed_oss", "SeedOssForQuestionAnswering"),
981985
("squeezebert", "SqueezeBertForQuestionAnswering"),
982986
("t5", "T5ForQuestionAnswering"),
983987
("umt5", "UMT5ForQuestionAnswering"),
@@ -1066,6 +1070,7 @@
10661070
("roberta", "RobertaForTokenClassification"),
10671071
("roberta-prelayernorm", "RobertaPreLayerNormForTokenClassification"),
10681072
("roformer", "RoFormerForTokenClassification"),
1073+
("seed_oss", "SeedOssForTokenClassification"),
10691074
("starcoder2", "Starcoder2ForTokenClassification"),
10701075
("squeezebert", "SqueezeBertForTokenClassification"),
10711076
("stablelm", "StableLmForTokenClassification"),
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2025 Bytedance-Seed Ltd and the HuggingFace Inc. team. All rights reserved.
2+
#
3+
# This code is adapted from https://github.com/huggingface/transformers
4+
# with modifications to run transformers on mindspore.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
from .modeling_seed_oss import *

0 commit comments

Comments
 (0)