Skip to content

Commit d11976d

Browse files
authored
Fix phi4mini test model (#8971)
* Fix phi4mini test model * Remove pull trigger since done testing
1 parent 76edaf2 commit d11976d

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.ci/scripts/test_model.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,14 @@ test_model() {
100100
rm "./${MODEL_NAME}.pte"
101101
return # Skip running with portable executor runnner since portable doesn't support Qwen's biased linears.
102102
fi
103-
if [[ "${MODEL_NAME}" == "phi4_mini" ]]; then
103+
if [[ "${MODEL_NAME}" == "phi-4-mini" ]]; then
104104
# Install requirements for export_llama
105105
bash examples/models/llama/install_requirements.sh
106106
# Test export_llama script: python3 -m examples.models.llama.export_llama.
107107
"${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
108108
run_portable_executor_runner
109109
rm "./${MODEL_NAME}.pte"
110+
return
110111
fi
111112

112113
# Export a basic .pte and run the model.

examples/models/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"llava": ("llava", "LlavaModel"),
3636
"efficient_sam": ("efficient_sam", "EfficientSAM"),
3737
"qwen2_5": ("qwen2_5", "Qwen2_5Model"),
38-
"phi4_mini": ("phi4_mini", "Phi4MiniModel"),
38+
"phi-4-mini": ("phi-4-mini", "Phi4MiniModel"),
3939
}
4040

4141
__all__ = [

examples/models/llama/export_llama_lib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"llama3_2",
9494
"static_llama",
9595
"qwen2_5",
96-
"phi4_mini",
96+
"phi-4-mini",
9797
]
9898
TORCHTUNE_DEFINED_MODELS = ["llama3_2_vision"]
9999

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This source code is licensed under the BSD-style license found in the
2+
# LICENSE file in the root directory of this source tree.
3+
4+
from executorch.examples.models.llama.model import Llama2Model
5+
6+
7+
class Phi4MiniModel(Llama2Model):
8+
def __init__(self, **kwargs):
9+
super().__init__(**kwargs)
10+
11+
12+
__all__ = [
13+
"Phi4MiniModel",
14+
]

0 commit comments

Comments
 (0)