Skip to content

Commit 17e141c

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 35a847e commit 17e141c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

examples/models/llama2/export_llama_lib.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,16 @@ 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
483481
if modelname[-4:] == ".pte":
484482
modelname = modelname[:-4]
483+
output_file = modelname
484+
else:
485+
output_file = f"{builder.output_dir}/{modelname}.pte"
486+
else:
487+
output_file = f"{builder.output_dir}/{modelname}.pte"
485488

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

488491
return output_file

0 commit comments

Comments
 (0)