Skip to content

Commit 7f49029

Browse files
cymbalrushfacebook-github-bot
authored andcommitted
Fix debugger tests. (#2489)
Summary: Debugger tests were failing because the `export` script was generating compiled models. Fixes the issue by making sure that the `compile` arg defaults to `false`. Pull Request resolved: #2489 Reviewed By: mcr229 Differential Revision: D55028099 Pulled By: shoumikhin fbshipit-source-id: ba304c90a18b52993aac60a113b90ab63c917e53
1 parent 1255c47 commit 7f49029

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

examples/apple/coreml/scripts/export.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ def parse_args() -> argparse.ArgumentParser:
6464
help=f"Provide compute precision for the model. Valid ones: {[[precision.value for precision in ct.precision]]}",
6565
)
6666

67-
parser.add_argument("--compile", action=argparse.BooleanOptionalAction)
67+
parser.add_argument(
68+
"--compile",
69+
action=argparse.BooleanOptionalAction,
70+
required=False,
71+
default=False,
72+
)
6873
parser.add_argument("--use_partitioner", action=argparse.BooleanOptionalAction)
6974
parser.add_argument("--generate_etrecord", action=argparse.BooleanOptionalAction)
7075
parser.add_argument("--save_processed_bytes", action=argparse.BooleanOptionalAction)
@@ -128,11 +133,10 @@ def save_processed_bytes(processed_bytes, model_name, compute_unit):
128133

129134

130135
def generate_compile_specs_from_args(args):
131-
model_type = (
132-
CoreMLBackend.MODEL_TYPE.MODEL
133-
if args.compile
134-
else CoreMLBackend.MODEL_TYPE.COMPILED_MODEL
135-
)
136+
model_type = CoreMLBackend.MODEL_TYPE.MODEL
137+
if args.compile:
138+
model_type = CoreMLBackend.MODEL_TYPE.COMPILED_MODEL
139+
136140
compute_precision = ct.precision(args.compute_precision)
137141
compute_unit = ct.ComputeUnit[args.compute_unit.upper()]
138142

0 commit comments

Comments
 (0)