def _try_stop_remote_run(run, remote_lock, no_wait): from guild import plugin as pluginlib # expensive try: plugin = pluginlib.for_name(remote_lock.plugin_name) except LookupError: log.warning( "error syncing run '%s': plugin '%s' not available", run.id, remote_lock.plugin_name, ) else: cli.out("Stopping %s (remote)" % run.id, err=True) plugin.stop_run(run, dict(no_wait=no_wait))
def python_script_opdef_loaded(self, opdef): if opdef.output_scalars is not None: return assert opdef.main, opdef plugin = pluginlib.for_name("python_script") main_mod = op_util.split_main(opdef.main)[0] model_paths = op_util.opdef_model_paths(opdef) try: _sys_path, mod_path = plugin.find_module(main_mod, model_paths) except ImportError: return script = python_util.Script(mod_path) if self.is_keras_script(script): if opdef.output_scalars is None: opdef.output_scalars = KERAS_OUTPUT_SCALARS
def python_script_opdef(self, op): if (op.compare is not None and op.output_scalars is not None): return assert op.main, op plugin = pluginlib.for_name("python_script") main_mod = op_util.split_main(op.main)[0] model_paths = op_util.opdef_model_paths(op) try: _sys_path, mod_path = plugin.find_module(main_mod, model_paths) except ImportError: return script = python_util.Script(mod_path) if self.is_keras_script(script): if op.compare is None: flags = ["=%s" % f.name for f in op.flags] op.compare = flags + KERAS_BASE_COMPARE if op.output_scalars is None: op.output_scalars = KERAS_OUTPUT_SCALARS
def _plugin_for_name(name): from guild import plugin # expensive return plugin.for_name(name)
def _flags_data(self): _log_flags_info("### Script flags for %s", os.path.normpath(self.script_path)) plugin = pluginlib.for_name("python_script") return plugin._flags_data_for_path(self.script_path, "", ".")
def _flags_data(self): plugin = pluginlib.for_name("python_script") return plugin.flags_data_for_path(self.script_path, ".")