trains/model.py
def connect(self, task):
        """
        Connect current model with a specific task, only supported for preexisting models,

        i.e. not supported on objects created with create_and_connect()
        When running in debug mode (i.e. locally), the task is updated with the model object
        (i.e. task input model is the load_model_id)
        When running remotely (i.e. from a daemon) the model is being updated from the task
        Notice! when running remotely the load_model_id is ignored and loaded from the task object
        regardless of the code

        :param task: Task object
        """
        self._set_task(task)

        if running_remotely() and task.input_model and task.is_main_task():
            self._base_model = task.input_model
            self._base_model_id = task.input_model.id
        else:
            # we should set the task input model to point to us
            model = self._get_base_model()
            # try to store the input model id, if it is not empty
            if model.id != self._EMPTY_MODEL_ID:
                task.set_input_model(model_id=model.id)
            # only copy the model design if the task has no design to begin with
            if not self._task.get_model_config_text():
                task.set_model_config(config_text=model.model_design)
            if not self._task.get_labels_enumeration():
                task.set_model_label_enumeration(model.data.labels)

        # If there was an output model connected, it may need to be updated by
        # the newly connected input model
        self.task._reconnect_output_model()

        Connect current model with a specific task, only supported for preexisting models,

        i.e. not supported on objects created with create_and_connect()
        When running in debug mode (i.e. locally), the task is updated with the model object
        (i.e. task input model is the load_model_id)
        When running remotely (i.e. from a daemon) the model is being updated from the task
        Notice! when running remotely the load_model_id is ignored and loaded from the task object
        regardless of the code

        :param task: Task object
        
Connect current model with a specific task, only supported for preexisting models,
i.e. not supported on objects created with create_and_connect()
When running in debug mode , the task is updated with the model object

When running remotely  the model is being updated from the task
Notice. when running remotely the load_model_id is ignored and loaded from the task object
regardless of the code
Connect current model with a specific task only supported for preexisting models i . e . not supported on objects created with create_and_connect () When running in debug mode the task is updated with the model object When running remotely the model is being updated from the task Notice . when running remotely the load_model_id is ignored and loaded from the task object regardless of the code
def connect(self, task):
        self._set_task(task)
        if running_remotely() and task.input_model and task.is_main_task():
            self._base_model = task.input_model
            self._base_model_id = task.input_model.id
        else:
            model = self._get_base_model()
            if model.id != self._EMPTY_MODEL_ID:
                task.set_input_model(model_id=model.id)
            if not self._task.get_model_config_text():
                task.set_model_config(config_text=model.model_design)
            if not self._task.get_labels_enumeration():
                task.set_model_label_enumeration(model.data.labels)
        self.task._reconnect_output_model()
def connect ( self , task ) : self . _set_task ( task ) if running_remotely ( ) and task . input_model and task . is_main_task ( ) : self . _base_model = task . input_model self . _base_model_id = task . input_model . id else : model = self . _get_base_model ( ) if model . id != self . _EMPTY_MODEL_ID : task . set_input_model ( model_id = model . id ) if not self . _task . get_model_config_text ( ) : task . set_model_config ( config_text = model . model_design ) if not self . _task . get_labels_enumeration ( ) : task . set_model_label_enumeration ( model . data . labels ) self . task . _reconnect_output_model ( )
Connect current model with a specific task, only supported for preexisting models,
i.e.
Connect current model with a specific task only supported for preexisting models i . e .
"""
        Connect current model with a specific task, only supported for preexisting models,

        i.e. not supported on objects created with create_and_connect()
        When running in debug mode (i.e. locally), the task is updated with the model object
        (i.e. task input model is the load_model_id)
        When running remotely (i.e. from a daemon) the model is being updated from the task
        Notice! when running remotely the load_model_id is ignored and loaded from the task object
        regardless of the code

        :param task: Task object
        """ # we should set the task input model to point to us # try to store the input model id, if it is not empty # only copy the model design if the task has no design to begin with # If there was an output model connected, it may need to be updated by # the newly connected input model
self
task
None