Skip to content

Commit

Permalink
[sparsify.run one-shot] CLI propagation of recipe_args (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfineran committed May 4, 2023
1 parent bec4f0d commit 0c5ed2c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sparsify/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import json
from pathlib import Path

import click
Expand Down Expand Up @@ -42,6 +43,10 @@ def one_shot(**kwargs):
# raises exception if sparsifyml not installed
from sparsify.one_shot import one_shot

recipe_args = kwargs.get("recipe_args")
if isinstance(recipe_args, str):
recipe_args = json.loads(recipe_args)

one_shot.one_shot(
task=kwargs["use_case"],
model_file=Path(kwargs["model"]),
Expand All @@ -51,6 +56,7 @@ def one_shot(**kwargs):
eval_metric=kwargs["eval_metric"],
opt_level=kwargs["optim_level"],
recipe_file=Path(kwargs["recipe"]) if kwargs["recipe"] is not None else None,
recipe_args=recipe_args,
)


Expand Down

0 comments on commit 0c5ed2c

Please sign in to comment.