Skip to content

Commit ec34b6e

Browse files
authored
feat(transformers/models): add phi (#1073)
* phi phi phi phi fix * fix * fix * fix * fix * fix
1 parent 2d3feb4 commit ec34b6e

File tree

8 files changed

+1119
-0
lines changed

8 files changed

+1119
-0
lines changed

mindone/transformers/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@
225225
PersimmonModel,
226226
PersimmonPreTrainedModel,
227227
)
228+
from .models.phi import (
229+
PhiForCausalLM,
230+
PhiForSequenceClassification,
231+
PhiForTokenClassification,
232+
PhiModel,
233+
PhiPreTrainedModel,
234+
)
228235
from .models.phi3 import (
229236
Phi3ForCausalLM,
230237
Phi3ForSequenceClassification,

mindone/transformers/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
mixtral,
3232
mobilebert,
3333
persimmon,
34+
phi,
3435
phi3,
3536
qwen2,
3637
qwen2_5_omni,

mindone/transformers/models/auto/configuration_auto.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
("mt5", "MT5Config"),
6464
("megatron-bert", "MegatronBertConfig"),
6565
("mixtral", "MixtralConfig"),
66+
("phi", "PhiConfig"),
6667
("phi3", "Phi3Config"),
6768
("qwen2", "Qwen2Config"),
6869
("qwen2_5_vl", "Qwen2_5_VLConfig"),
@@ -130,6 +131,7 @@
130131
("mt5", "MT5"),
131132
("megatron-bert", "Megatron-BERT"),
132133
("mixtral", "Mixtral"),
134+
("phi", "Phi"),
133135
("phi3", "Phi3"),
134136
("qwen2", "Qwen2"),
135137
("qwen2_5_vl", "Qwen2_5_VL"),

mindone/transformers/models/auto/modeling_auto.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
("mt5", "MT5Model"),
6565
("megatron-bert", "MegatronBertModel"),
6666
("mixtral", "MixtralModel"),
67+
("phi", "PhiModel"),
6768
("phi3", "Phi3Model"),
6869
("qwen2", "Qwen2Model"),
6970
("qwen2_5_vl", "Qwen2_5_VLModel"),
@@ -145,6 +146,7 @@
145146
("granitemoeshared", "GraniteMoeSharedForCausalLM"),
146147
("llama", "LlamaForCausalLM"),
147148
("megatron-bert", "MegatronBertForCausalLM"),
149+
("phi", "PhiForCausalLM"),
148150
("phi3", "Phi3ForCausalLM"),
149151
("mixtral", "MixtralForCausalLM"),
150152
("qwen2", "Qwen2ForCausalLM"),
@@ -316,6 +318,7 @@
316318
("mt5", "MT5ForSequenceClassification"),
317319
("megatron-bert", "MegatronBertForSequenceClassification"),
318320
("mixtral", "MixtralForSequenceClassification"),
321+
("phi", "PhiForSequenceClassification"),
319322
("phi3", "Phi3ForSequenceClassification"),
320323
("qwen2", "Qwen2ForSequenceClassification"),
321324
("qwen3", "Qwen3ForSequenceClassification"),
@@ -368,6 +371,7 @@
368371
("persimmon", "PersimmonForTokenClassification"),
369372
("megatron-bert", "MegatronBertForTokenClassification"),
370373
("mixtral", "MixtralForTokenClassification"),
374+
("phi", "PhiForTokenClassification"),
371375
("phi3", "Phi3ForTokenClassification"),
372376
("qwen2", "Qwen2ForTokenClassification"),
373377
("qwen3", "Qwen3ForTokenClassification"),
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .modeling_phi import (
2+
PhiForCausalLM,
3+
PhiForSequenceClassification,
4+
PhiForTokenClassification,
5+
PhiModel,
6+
PhiPreTrainedModel,
7+
)

0 commit comments

Comments
 (0)