File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed
examples/qualcomm/oss_scripts/llama Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,24 @@ python_library(
15
15
],
16
16
)
17
17
18
+ python_library(
19
+ name = "llama_lib",
20
+ srcs = ["llama.py"],
21
+ deps = [
22
+ "//caffe2:torch",
23
+ "//executorch/backends/qualcomm/partition:partition",
24
+ "//executorch/backends/qualcomm/quantizer:quantizer",
25
+ "//executorch/devtools:lib",
26
+ "//executorch/examples/models:models",
27
+ "//executorch/examples/qualcomm/oss_scripts/llama:static_llama",
28
+ "//executorch/examples/qualcomm:utils",
29
+ "//executorch/extension/export_util:export_util",
30
+ "//executorch/extension/llm/custom_ops:model_sharding_py",
31
+ "//executorch/extension/llm/export:export_lib",
32
+ "//executorch/extension/pybindings:aten_lib",
33
+ ],
34
+ )
35
+
18
36
python_binary(
19
37
name = "llama",
20
38
srcs = ["llama.py"],
Original file line number Diff line number Diff line change @@ -819,7 +819,7 @@ def post_process():
819
819
logging .info (f"Results[{ idx } ]:\n { output } " )
820
820
821
821
822
- def main ():
822
+ def _build_parser ():
823
823
parser = setup_common_args_and_variables ()
824
824
parser .add_argument (
825
825
"-a" ,
@@ -944,7 +944,13 @@ def main():
944
944
type = str ,
945
945
)
946
946
947
- args = parser .parse_args ()
947
+ return parser
948
+
949
+
950
+ def main (args ) -> None :
951
+ parser = _build_parser ()
952
+
953
+ args = parser .parse_args (args )
948
954
if args .compile_only and args .pre_gen_pte :
949
955
exit ("Cannot set both compile_only and pre_gen_pte as true" )
950
956
@@ -1035,4 +1041,4 @@ def main():
1035
1041
1036
1042
# flake8: noqa: C901
1037
1043
if __name__ == "__main__" :
1038
- main ()
1044
+ main (sys . argv [ 1 :] )
You can’t perform that action at this time.
0 commit comments