@staticmethod
def _init_model_with_state_dict(state):
    label_dictionary = state['label_dictionary']
    label_type = ('default_label' if (not state['label_type']) else state['label_type'])
    model: TARSClassifier = TARSClassifier(task_name=state['current_task'], label_dictionary=label_dictionary, label_type=label_type, embeddings=state['tars_model'].document_embeddings, num_negative_labels_to_sample=state['num_negative_labels_to_sample'])
    model._task_specific_attributes = state['task_specific_attributes']
    model.load_state_dict(state['state_dict'])
    return model
@staticmethod
def _init_model_with_state_dict(state):
    label_dictionary = state['label_dictionary']
    label_type = ('default_label' if (not state['label_type']) else state['label_type'])
    model: TARSClassifier = TARSClassifier(task_name=state['current_task'], label_dictionary=label_dictionary, label_type=label_type, embeddings=state['tars_model'].document_embeddings, num_negative_labels_to_sample=state['num_negative_labels_to_sample'])
    model._task_specific_attributes = state['task_specific_attributes']
    model.load_state_dict(state['state_dict'])
    return model