Skip to content

Commit 3323164

Browse files
authored
Make it runnable via buck
Differential Revision: D61567500 Pull Request resolved: #4811
1 parent 78b0867 commit 3323164

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

examples/models/phi-3-mini/export_phi-3-mini.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from .phi_3_mini import Phi3Mini
2929

3030

31-
def main(args) -> None:
31+
def export(args) -> None:
3232
torch.manual_seed(0)
3333

3434
if args.context_length == "4k":
@@ -90,7 +90,7 @@ def main(args) -> None:
9090
file.write(et_program.buffer)
9191

9292

93-
if __name__ == "__main__":
93+
def main():
9494
parser = argparse.ArgumentParser()
9595
parser.add_argument(
9696
"-c",
@@ -113,4 +113,8 @@ def main(args) -> None:
113113
default="phi-3-mini.pte",
114114
help="Override the output filename of the saved pte model file.",
115115
)
116-
main(parser.parse_args())
116+
export(parser.parse_args())
117+
118+
119+
if __name__ == "__main__":
120+
main()

0 commit comments

Comments
 (0)