This commit is contained in:
hiyouga 2023-08-08 21:28:28 +08:00
parent 4b841a6b35
commit caa0eda27d
1 changed files with 4 additions and 4 deletions

View File

@ -119,10 +119,10 @@ def preprocess_dataset(
print("input_ids:\n{}".format(example["input_ids"]))
print("inputs:\n{}".format(tokenizer.decode(example["input_ids"], skip_special_tokens=False)))
print("label_ids:\n{}".format(example["labels"]))
print("labels:\n{}".format(
tokenizer.decode([d if d != IGNORE_INDEX else tokenizer.pad_token_id for d in example["labels"]],
skip_special_tokens=False)
))
print("labels:\n{}".format(''.join([
tokenizer.decode(d, skip_special_tokens=False)
if d != IGNORE_INDEX else '-100' for d in example["labels"]
])))
def print_pairwise_dataset_example(example):
print("accept_ids:\n{}".format(example["accept_ids"]))