def _run(op): try: result = op.run() except deps.DependencyError as e: _handle_dependency_error(e) else: _handle_run_result(result)
def _run_op(op, args): try: returncode = op.run(args.quiet, _op_pidfile(args), args.stop_after) except deps.DependencyError as e: _handle_dependency_error(e) except guild.op.ProcessError as e: _handle_process_error(e) else: _handle_run_exit(returncode, op, args)
def _run_op(op, args, extra_env=None): try: _, exit_status = oplib.run(op, quiet=args.quiet, pidfile=_op_pidfile(args), stop_after=args.stop_after, extra_env=extra_env) except op_dep.OpDependencyError as e: _op_dependency_error(e) except oplib.ProcessError as e: _op_process_error(op, e) else: _handle_run_exit(exit_status)
def main(args): model_name, op_name = _parse_opspec(args.opspec) model = _resolve_model(model_name, args) project_op = _resolve_op(op_name, model) _apply_flags_to_op(args, project_op) _apply_disable_plugins(args, project_op) op = guild.op.from_project_op(project_op) if args.print_cmd: _print_op_command(op) elif args.print_env: _print_op_env(op) else: if args.yes or _confirm_op(op): result = op.run() _handle_run_result(result)
def _prepare(op): op.run()
def _evaluate(op): op.run()
def _train(op): exit_status = op.run() raise guild.cli.Exit("", exit_status)