Skip to content

Commit

Permalink
Make config file optional when exporting (facebookresearch#433)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebookresearch#433

^ as title

Reviewed By: hikushalhere

Differential Revision: D14713838

fbshipit-source-id: 374351bc6d2308d84717d521d31aa1292283cf88
  • Loading branch information
seayoung1112 authored and facebook-github-bot committed Apr 2, 2019
1 parent 1ffc483 commit 8e9e152
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pytext/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,11 @@ def train(context):
@click.pass_context
def export(context, model, output_path, output_onnx_path):
"""Convert a pytext model snapshot to a caffe2 model."""
config = context.obj.load_config()
model = model or config.save_snapshot_path
output_path = output_path or config.export_caffe2_path
output_onnx_path = output_onnx_path or config.export_onnx_path
if not model:
config = context.obj.load_config()
model = config.save_snapshot_path
output_path = config.export_caffe2_path
output_onnx_path = config.export_onnx_path
print(
f"Exporting {model} to caffe2 file: {output_path} and onnx file: {output_onnx_path}"
)
Expand Down

0 comments on commit 8e9e152

Please sign in to comment.