diff --git a/.ci/scripts/test_model.sh b/.ci/scripts/test_model.sh index 65d04dc3886..5940affc109 100755 --- a/.ci/scripts/test_model.sh +++ b/.ci/scripts/test_model.sh @@ -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. diff --git a/examples/models/__init__.py b/examples/models/__init__.py index 778138a1802..26c84c48fc6 100644 --- a/examples/models/__init__.py +++ b/examples/models/__init__.py @@ -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__ = [ diff --git a/examples/models/llama/export_llama_lib.py b/examples/models/llama/export_llama_lib.py index 6e5eca11d0e..2319ec0c6a7 100644 --- a/examples/models/llama/export_llama_lib.py +++ b/examples/models/llama/export_llama_lib.py @@ -93,7 +93,7 @@ "llama3_2", "static_llama", "qwen2_5", - "phi4_mini", + "phi-4-mini", ] TORCHTUNE_DEFINED_MODELS = ["llama3_2_vision"] diff --git a/examples/models/phi-4-mini/__init__.py b/examples/models/phi-4-mini/__init__.py new file mode 100644 index 00000000000..056f2c26314 --- /dev/null +++ b/examples/models/phi-4-mini/__init__.py @@ -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", +]