Skip to content

Commit c102906

Browse files
authored
feat[transformers] add hubert model (#1128)
* hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert hubert * hubert * hubert * hubert * hubert * fix * fix * fix * fix * fix * fix * change copyright
1 parent 0574ba5 commit c102906

File tree

11 files changed

+1505
-12
lines changed

11 files changed

+1505
-12
lines changed

mindone/transformers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
HieraModel,
249249
HieraPreTrainedModel,
250250
)
251+
from .models.hubert import HubertForCTC, HubertForSequenceClassification, HubertModel, HubertPreTrainedModel
251252
from .models.idefics3 import (
252253
Idefics3ForConditionalGeneration,
253254
Idefics3Model,

mindone/transformers/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
granitemoe,
4646
granitemoeshared,
4747
hiera,
48+
hubert,
4849
idefics3,
4950
ijepa,
5051
imagegpt,

mindone/transformers/models/auto/configuration_auto.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
("bit", "BitConfig"),
4444
("blip", "BlipConfig"),
4545
("blip-2", "Blip2Config"),
46+
("camembert", "CamembertConfig"),
47+
("convbert", "ConvBertConfig"),
4648
("clip", "CLIPConfig"),
4749
("clip_vision_model", "CLIPVisionConfig"),
4850
("deberta", "DebertaConfig"),
@@ -60,8 +62,7 @@
6062
("granitemoeshared", "GraniteMoeSharedConfig"),
6163
("helium", "HeliumConfig"),
6264
("hiera", "HieraConfig"),
63-
("camembert", "CamembertConfig"),
64-
("convbert", "ConvBertConfig"),
65+
("hubert", "HubertConfig"),
6566
("idefics", "IdeficsConfig"),
6667
("idefics2", "Idefics2Config"),
6768
("idefics3", "Idefics3Config"),
@@ -155,6 +156,7 @@
155156
("qwen2_audio_encoder", "Qwen2AudioEncoder"),
156157
("helium", "Helium"),
157158
("hiera", "Hiera"),
159+
("hubert", "Hubert"),
158160
("idefics", "IDEFICS"),
159161
("idefics2", "Idefics2"),
160162
("idefics3", "Idefics3"),

mindone/transformers/models/auto/modeling_auto.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
("siglip", "SiglipModel"),
7373
("helium", "HeliumModel"),
7474
("hiera", "HieraModel"),
75+
("hubert", "HubertModel"),
7576
("idefics", "IdeficsModel"),
7677
("idefics2", "Idefics2Model"),
7778
("idefics3", "Idefics3Model"),
@@ -121,6 +122,7 @@
121122
("gpt2", "GPT2LMHeadModel"),
122123
("gemma3", "Gemma3ForConditionalGeneration"),
123124
("hiera", "HieraForPreTraining"),
125+
("hubert", "HubertForPreTraining"),
124126
("idefics", "IdeficsForVisionText2Text"),
125127
("idefics2", "Idefics2ForConditionalGeneration"),
126128
("idefics3", "Idefics3ForConditionalGeneration"),
@@ -216,6 +218,7 @@
216218
("dpt", "DPTModel"),
217219
("glpn", "GLPNModel"),
218220
("hiera", "HieraModel"),
221+
("hubert", "HubertModel"),
219222
("ijepa", "IJepaModel"),
220223
("imagegpt", "ImageGPTModel"),
221224
("levit", "LevitModel"),
@@ -385,6 +388,7 @@
385388
("gemma2", "Gemma2ForSequenceClassification"),
386389
("glm", "GlmForSequenceClassification"),
387390
("helium", "HeliumForSequenceClassification"),
391+
("hubert", "HubertForSequenceClassification"),
388392
("led", "LEDForSequenceClassification"),
389393
("starcoder2", "Starcoder2ForSequenceClassification"),
390394
("canine", "CanineForSequenceClassification"),
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2024 The HuggingFace Team. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from .modeling_hubert import *

0 commit comments

Comments
 (0)