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(
9696
9797runtime.python_library(
9898 name = "source_transformation",
99+ visibility = [
100+ "//executorch/examples/...",
101+ ],
99102 srcs = [
100103 "source_transformation/apply_spin_quant_r1_r2.py",
101104 "source_transformation/attention.py",
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ python_library(
1919 name = "llama_lib",
2020 srcs = ["llama.py"],
2121 deps = [
22+ "//executorch/examples/models/llama:source_transformation",
2223 "//caffe2:torch",
2324 "//executorch/backends/qualcomm/partition:partition",
2425 "//executorch/backends/qualcomm/quantizer:quantizer",
Original file line number Diff line number Diff line change @@ -1039,10 +1039,7 @@ def _build_parser():
10391039 return parser
10401040
10411041
1042- def main (args ) -> None :
1043- parser = _build_parser ()
1044-
1045- args = parser .parse_args (args )
1042+ def export_llama (args ) -> None :
10461043 if args .compile_only and args .pre_gen_pte :
10471044 exit ("Cannot set both compile_only and pre_gen_pte as true" )
10481045
@@ -1143,6 +1140,12 @@ def main(args) -> None:
11431140 raise Exception (e )
11441141
11451142
1143+ def main ():
1144+ parser = _build_parser ()
1145+ args = parser .parse_args ()
1146+ export_llama (args )
1147+
1148+
11461149# flake8: noqa: C901
11471150if __name__ == "__main__" :
1148- main (sys . argv [ 1 :] )
1151+ main ()
You can’t perform that action at this time.
0 commit comments