Skip to content

Commit ebf6f2f

Browse files
committed
add kyutai_speech_to_text
1 parent 780e3fc commit ebf6f2f

File tree

10 files changed

+1631
-2
lines changed

10 files changed

+1631
-2
lines changed

mindone/transformers/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,11 @@
728728
JetMoePreTrainedModel,
729729
)
730730
from .models.kosmos2 import Kosmos2ForConditionalGeneration, Kosmos2Model, Kosmos2PreTrainedModel
731+
from .models.kyutai_speech_to_text import (
732+
KyutaiSpeechToTextForConditionalGeneration,
733+
KyutaiSpeechToTextModel,
734+
KyutaiSpeechToTextPreTrainedModel,
735+
)
731736
from .models.layoutlm import (
732737
LayoutLMForMaskedLM,
733738
LayoutLMForQuestionAnswering,

mindone/transformers/generation/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,7 @@ def _supports_default_dynamic_cache(cls) -> bool:
20502050
"""
20512051
# NOTE: remove xlnet/reformer when the models are deprecated, non-standard model architecture/cache name
20522052
return not cls._is_stateful and all(
2053-
special_model_name not in cls.__name__.lower()
2053+
special_model_name not in cls.__class__.__name__.lower()
20542054
for special_model_name in [
20552055
"reformer",
20562056
"minimax",

mindone/transformers/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
jamba,
114114
jetmoe,
115115
kosmos2,
116+
kyutai_speech_to_text,
116117
layoutlm,
117118
layoutlmv3,
118119
levit,

mindone/transformers/models/auto/configuration_auto.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
("jamba", "JambaConfig"),
139139
("jetmoe", "JetMoeConfig"),
140140
("kosmos-2", "Kosmos2Config"),
141+
("kyutai_speech_to_text", "KyutaiSpeechToTextConfig"),
141142
("layoutlm", "LayoutLMConfig"),
142143
("layoutlmv3", "LayoutLMv3Config"),
143144
("led", "LEDConfig"),
@@ -406,6 +407,7 @@
406407
("jamba", "Jamba"),
407408
("jetmoe", "JetMoe"),
408409
("kosmos-2", "KOSMOS-2"),
410+
("kyutai_speech_to_text", "KyutaiSpeechToText"),
409411
("led", "LED"),
410412
("levit", "LeViT"),
411413
("lilt", "LiLT"),

mindone/transformers/models/auto/modeling_auto.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
("jamba", "JambaModel"),
131131
("jetmoe", "JetMoeModel"),
132132
("kosmos-2", "Kosmos2Model"),
133+
("kyutai_speech_to_text", "KyutaiSpeechToTextModel"),
133134
("layoutlm", "LayoutLMModel"),
134135
("layoutlmv3", "LayoutLMv3Model"),
135136
("led", "LEDModel"),
@@ -838,6 +839,7 @@
838839

839840
MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES = OrderedDict(
840841
[
842+
("kyutai_speech_to_text", "KyutaiSpeechToTextForConditionalGeneration"),
841843
("moonshine", "MoonshineForConditionalGeneration"),
842844
("pop2piano", "Pop2PianoForConditionalGeneration"),
843845
("seamless_m4t", "SeamlessM4TForSpeechToText"),
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2025 The HuggingFace 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_kyutai_speech_to_text import *

0 commit comments

Comments
 (0)