Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/models/llama/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ runtime.command_alias(

runtime.python_library(
name = "source_transformation",
visibility = [
"//executorch/examples/...",
],
srcs = [
"source_transformation/apply_spin_quant_r1_r2.py",
"source_transformation/attention.py",
Expand Down
1 change: 1 addition & 0 deletions examples/qualcomm/oss_scripts/llama/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ python_library(
name = "llama_lib",
srcs = ["llama.py"],
deps = [
"//executorch/examples/models/llama:source_transformation",
"//caffe2:torch",
"//executorch/backends/qualcomm/partition:partition",
"//executorch/backends/qualcomm/quantizer:quantizer",
Expand Down
13 changes: 8 additions & 5 deletions examples/qualcomm/oss_scripts/llama/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,10 +1039,7 @@ def _build_parser():
return parser


def main(args) -> None:
parser = _build_parser()

args = parser.parse_args(args)
def export_llama(args) -> None:
if args.compile_only and args.pre_gen_pte:
exit("Cannot set both compile_only and pre_gen_pte as true")

Expand Down Expand Up @@ -1143,6 +1140,12 @@ def main(args) -> None:
raise Exception(e)


def main():
parser = _build_parser()
args = parser.parse_args()
export_llama(args)


# flake8: noqa: C901
if __name__ == "__main__":
main(sys.argv[1:])
main()
Loading