Skip to content

Commit 912876c

Browse files
Michael Gschwindfacebook-github-bot
authored andcommitted
Add new tests: 4b dq, kv sdpa (#2378)
Summary: Add new tests: 4b dq, kv sdpa Reviewed By: manuelcandales Differential Revision: D54806721
1 parent 42eeebc commit 912876c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

examples/models/llama2/export_llama_lib.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,20 @@ def _export_llama(modelname, args) -> str: # noqa: C901
476476
if builder.dtype == DType.fp16:
477477
modelname = f"{modelname}_h"
478478

479-
builder.save_to_pte(modelname)
480-
481479
if args.output_name:
482480
modelname = args.output_name
483-
if modelname[-4:] == ".pte":
481+
if modelname.endswith(".pte"):
482+
output_file = modelname
484483
modelname = modelname[:-4]
484+
print(f"modelname: {modelname}")
485+
print(f"output_file: {output_file}")
486+
else:
487+
output_file = f"{builder.output_dir}/{modelname}.pte"
488+
print(f"modelname: {modelname}")
489+
print(f"output_file: {output_file}")
490+
else:
491+
output_file = f"{builder.output_dir}/{modelname}.pte"
485492

486-
output_file = f"{builder.output_dir}/{modelname}.pte"
493+
builder.save_to_pte(output_file)
487494

488495
return output_file

0 commit comments

Comments
 (0)