Skip to content

Commit cc88b03

Browse files
authored
Qwen and Phi-4-Mini targets (#13449)
Summary: Targets for Qwen 3, Phi-4-Mini Reviewed By: cccclai Differential Revision: D80015307
1 parent bf4f0a3 commit cc88b03

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed

examples/models/llama/TARGETS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ runtime.python_binary(
8484
],
8585
deps = [
8686
":export_library",
87+
":eval_library",
8788
"//caffe2:torch",
8889
"//executorch/extension/pybindings:aten_lib",
8990
"//executorch/extension/llm/export:export_llm_lib",

examples/models/llama/export_llama_lib.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -605,17 +605,11 @@ def export_llama(
605605
if not llm_config.base.checkpoint and model_name in HUGGING_FACE_REPO_IDS:
606606
repo_id = HUGGING_FACE_REPO_IDS[model_name]
607607
if model_name == "qwen2_5":
608-
from executorch.examples.models.qwen2_5 import ( # pyre-ignore[21]
609-
convert_weights,
610-
)
608+
from executorch.examples.models.qwen2_5 import convert_weights
611609
elif model_name.startswith("qwen3"):
612-
from executorch.examples.models.qwen3 import ( # pyre-ignore[21]
613-
convert_weights,
614-
)
610+
from executorch.examples.models.qwen3 import convert_weights
615611
elif model_name == "phi_4_mini":
616-
from executorch.examples.models.phi_4_mini import ( # pyre-ignore[21]
617-
convert_weights,
618-
)
612+
from executorch.examples.models.phi_4_mini import convert_weights
619613
elif model_name == "smollm2":
620614
from executorch.examples.models.smollm2 import ( # pyre-ignore[21]
621615
convert_weights,

examples/qualcomm/oss_scripts/llama/TARGETS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ python_library(
3535

3636
python_library(
3737
name = "llama_lib",
38-
srcs = ["llama.py"],
38+
srcs = ["__init__.py", "llama.py"],
3939
deps = [
4040
":decoder_constants",
4141
":decoder_utils",
@@ -47,6 +47,7 @@ python_library(
4747
"//executorch/devtools:lib",
4848
"//executorch/examples/models:models",
4949
"//executorch/examples/models/llama:hf_download",
50+
"//executorch/examples/qualcomm/oss_scripts/llama:range_setting_pt2e",
5051
"//executorch/examples/qualcomm/oss_scripts/llama:static_llama",
5152
"//executorch/examples/qualcomm:utils",
5253
"//executorch/extension/export_util:export_util",
@@ -73,7 +74,6 @@ python_binary(
7374
],
7475
deps = [
7576
":llama_lib",
76-
"//executorch/examples/qualcomm/oss_scripts/llama:range_setting_pt2e",
7777
],
7878
)
7979

examples/qualcomm/oss_scripts/llama/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class HFModel(ABC):
3232
convert_weights: Callable
3333

3434

35-
SUPPORTED_HF_MODELS: Dict[str, Type[HFModel]] = {}
35+
SUPPORTED_HF_MODELS: Dict[str, HFModel] = {}
3636

3737

3838
def register_hf_model(name: str):

examples/qualcomm/oss_scripts/llama/llama.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ def _build_parser():
10401040
parser.add_argument(
10411041
"--model_mode",
10421042
help="Export and inference kv mode, hybrid mode, or lookahead decoding mode",
1043-
default="kv",
1043+
default="hybrid",
10441044
choices=["kv", "hybrid", "lookahead"],
10451045
type=str,
10461046
)

0 commit comments

Comments
 (0)