Skip to content

Commit

Permalink
Add Phi-3 mini to Optimum (#1841)
Browse files Browse the repository at this point in the history
* Load config from folder

* Add Phi-3 to normalized config
  • Loading branch information
kunal-vaishnavi authored May 9, 2024
1 parent 189dd25 commit db6db6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion optimum/modeling_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def from_pretrained(
if os.path.isdir(os.path.join(model_id, subfolder)) and cls.config_name == CONFIG_NAME:
if CONFIG_NAME in os.listdir(os.path.join(model_id, subfolder)):
config = AutoConfig.from_pretrained(
os.path.join(model_id, subfolder, CONFIG_NAME), trust_remote_code=trust_remote_code
os.path.join(model_id, subfolder), trust_remote_code=trust_remote_code
)
elif CONFIG_NAME in os.listdir(model_id):
config = AutoConfig.from_pretrained(
Expand Down
1 change: 1 addition & 0 deletions optimum/utils/normalized_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ class NormalizedConfigManager:
"pegasus": BartLikeNormalizedTextConfig,
"pix2struct": Pix2StructNormalizedTextConfig,
"phi": NormalizedTextConfig,
"phi3": NormalizedTextConfigWithGQA,
"poolformer": NormalizedVisionConfig,
"regnet": NormalizedVisionConfig,
"resnet": NormalizedVisionConfig,
Expand Down

0 comments on commit db6db6f

Please sign in to comment.