File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
qualcomm/oss_scripts/llama Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,9 @@ runtime.command_alias(
96
96
97
97
runtime.python_library(
98
98
name = "source_transformation",
99
+ visibility = [
100
+ "//executorch/examples/...",
101
+ ],
99
102
srcs = [
100
103
"source_transformation/apply_spin_quant_r1_r2.py",
101
104
"source_transformation/attention.py",
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ python_library(
19
19
name = "llama_lib",
20
20
srcs = ["llama.py"],
21
21
deps = [
22
+ "//executorch/examples/models/llama:source_transformation",
22
23
"//caffe2:torch",
23
24
"//executorch/backends/qualcomm/partition:partition",
24
25
"//executorch/backends/qualcomm/quantizer:quantizer",
Original file line number Diff line number Diff line change @@ -1039,10 +1039,7 @@ def _build_parser():
1039
1039
return parser
1040
1040
1041
1041
1042
- def main (args ) -> None :
1043
- parser = _build_parser ()
1044
-
1045
- args = parser .parse_args (args )
1042
+ def export_llama (args ) -> None :
1046
1043
if args .compile_only and args .pre_gen_pte :
1047
1044
exit ("Cannot set both compile_only and pre_gen_pte as true" )
1048
1045
@@ -1143,6 +1140,12 @@ def main(args) -> None:
1143
1140
raise Exception (e )
1144
1141
1145
1142
1143
+ def main ():
1144
+ parser = _build_parser ()
1145
+ args = parser .parse_args ()
1146
+ export_llama (args )
1147
+
1148
+
1146
1149
# flake8: noqa: C901
1147
1150
if __name__ == "__main__" :
1148
- main (sys . argv [ 1 :] )
1151
+ main ()
You can’t perform that action at this time.
0 commit comments