Ejemplo n.º 1
0
    def __init__(self, config: configure_finetuning.FinetuningConfig, tasks):
        self._config = config
        self._tasks = tasks
        self._name_to_task = {task.name: task for task in tasks}

        self._feature_specs = feature_spec.get_shared_feature_specs(config)
        for task in tasks:
            self._feature_specs += task.get_feature_specs()
        self._name_to_feature_config = {
            spec.name: spec.get_parsing_spec()
            for spec in self._feature_specs
        }
        assert len(self._name_to_feature_config) == len(self._feature_specs)
Ejemplo n.º 2
0
    def __init__(self, config: configure_finetuning.FinetuningConfig, tasks):
        self._config = config
        self._tasks = tasks
        self._name_to_task = {task.name: task for task in tasks}
        self._feature_specs = []

        # multi-choice mrc overwrites input_ids, input_mask, etc.
        if not any([isinstance(x, qa_tasks.MQATask) for x in tasks]):
            self._feature_specs = feature_spec.get_shared_feature_specs(config)
        for task in tasks:
            self._feature_specs += task.get_feature_specs()
        self._name_to_feature_config = {
            spec.name: spec.get_parsing_spec()
            for spec in self._feature_specs
        }
        assert len(self._name_to_feature_config) == len(self._feature_specs)