# Path: prompt_tuning/data/features.py
# T5_FEATURES = t5_tasks.DEFAULT_OUTPUT_FEATURES
# MODEL_TO_FEATURES = {
#     # We use the keys to prefix the tasks t5 is the default so we don't want a
#     # prefix, thus the strange empty string as the key.
#     "": T5_FEATURES,
# }
#   MT5_FEATURES = mt5_tasks.DEFAULT_OUTPUT_FEATURES
#   BYT5_FEATURES = byt5_tasks.DEFAULT_BYTE_OUTPUT_FEATURES
# 
# Path: prompt_tuning/data/tasks.py



from absl.testing import absltest
from absl.testing import parameterized
from prompt_tuning.data import features
from prompt_tuning.data import tasks  # pylint: disable=unused-import
import seqio
                   len(task_index_input_text.split()) + 1)

    # Check that we have added a single token to the tokenized result for
    # task_index vs taskless.
    self.assertEqual(task_index_input.shape[0], taskless_input.shape[0] + 1)

    # We don't test anything else, we don't know how many tokens the dataset
    # label tends to split into so don't check the tokenized output vs the
    # other tasks.

  @parameterized.named_parameters(
      dict(
          testcase_name="mrpc_from_qqp",
          mixture="glue_mrpc_from_qqp_zeroshot_v002",
          train="glue_qqp_v002",
          validation="glue_mrpc_from_qqp_v002"),
      dict(
          testcase_name="qqp_from_mrpc",
          mixture="glue_qqp_from_mrpc_zeroshot_v002",
          train="glue_mrpc_v002",
          validation="glue_qqp_from_mrpc_v002"),
  )
  def test_zero_shot_transfer(self, mixture, train, validation):
    print(mixture)
    mixture = seqio.get_mixture_or_task(mixture)
    train_task = [t for t in mixture.tasks if t.name == train][0]
    # Read the training task's validation split because it will be quicker.
    train_ds = train_task.get_dataset(None, "validation", shuffle=False)
    train_targets = set(
        [b["targets_pretokenized"].numpy().decode("utf-8") for b in train_ds])

# Path: prompt_tuning/data/features.py
# T5_FEATURES = t5_tasks.DEFAULT_OUTPUT_FEATURES
# MODEL_TO_FEATURES = {
#     # We use the keys to prefix the tasks t5 is the default so we don't want a
#     # prefix, thus the strange empty string as the key.
#     "": T5_FEATURES,
# }
#   MT5_FEATURES = mt5_tasks.DEFAULT_OUTPUT_FEATURES
#   BYT5_FEATURES = byt5_tasks.DEFAULT_BYTE_OUTPUT_FEATURES
# 
# Path: prompt_tuning/data/tasks.py



# Path: prompt_tuning/data/tasks_test.py
from absl.testing import absltest
from absl.testing import parameterized
from prompt_tuning.data import features
from prompt_tuning.data import tasks  # pylint: disable=unused-import
import seqio

                   len(task_index_input_text.split()) + 1)

    # Check that we have added a single token to the tokenized result for
    # task_index vs taskless.
    self.assertEqual(task_index_input.shape[0], taskless_input.shape[0] + 1)

    # We don't test anything else, we don't know how many tokens the dataset
    # label tends to split into so don't check the tokenized output vs the
    # other tasks.

  @parameterized.named_parameters(
      dict(
          testcase_name="mrpc_from_qqp",
          mixture="glue_mrpc_from_qqp_zeroshot_v002",
          train="glue_qqp_v002",
          validation="glue_mrpc_from_qqp_v002"),
      dict(
          testcase_name="qqp_from_mrpc",
          mixture="glue_qqp_from_mrpc_zeroshot_v002",
          train="glue_mrpc_v002",
          validation="glue_qqp_from_mrpc_v002"),
  )
  def test_zero_shot_transfer(self, mixture, train, validation):
    print(mixture)
    mixture = seqio.get_mixture_or_task(mixture)
    train_task = [t for t in mixture.tasks if t.name == train][0]
    # Read the training task's validation split because it will be quicker.
    train_ds = train_task.get_dataset(None, "validation", shuffle=False)
    train_targets = set(
        [b["targets_pretokenized"].numpy().decode("utf-8") for b in train_ds])

    validation_task = [t for t in mixture.tasks if t.name == validation][0]