Skip to content

Fix phi4mini test model #8971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .ci/scripts/test_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@ test_model() {
rm "./${MODEL_NAME}.pte"
return # Skip running with portable executor runnner since portable doesn't support Qwen's biased linears.
fi
if [[ "${MODEL_NAME}" == "phi4_mini" ]]; then
if [[ "${MODEL_NAME}" == "phi-4-mini" ]]; then
# Install requirements for export_llama
bash examples/models/llama/install_requirements.sh
# Test export_llama script: python3 -m examples.models.llama.export_llama.
"${PYTHON_EXECUTABLE}" -m examples.models.llama.export_llama --model "${MODEL_NAME}" -c examples/models/llama/params/demo_rand_params.pth -p examples/models/phi-4-mini/config.json
run_portable_executor_runner
rm "./${MODEL_NAME}.pte"
return
fi

# Export a basic .pte and run the model.
Expand Down
2 changes: 1 addition & 1 deletion examples/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"llava": ("llava", "LlavaModel"),
"efficient_sam": ("efficient_sam", "EfficientSAM"),
"qwen2_5": ("qwen2_5", "Qwen2_5Model"),
"phi4_mini": ("phi4_mini", "Phi4MiniModel"),
"phi-4-mini": ("phi-4-mini", "Phi4MiniModel"),
}

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion examples/models/llama/export_llama_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"llama3_2",
"static_llama",
"qwen2_5",
"phi4_mini",
"phi-4-mini",
]
TORCHTUNE_DEFINED_MODELS = ["llama3_2_vision"]

Expand Down
14 changes: 14 additions & 0 deletions examples/models/phi-4-mini/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

from executorch.examples.models.llama.model import Llama2Model


class Phi4MiniModel(Llama2Model):
def __init__(self, **kwargs):
super().__init__(**kwargs)


__all__ = [
"Phi4MiniModel",
]
Loading