You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The value for answer_choices is a string representation of a list, which is not the expected format for the tokenizer. The tokenizer expects a list of strings or a list of lists of strings.
To fix this, we need to convert the string representation of the list into an actual list. We can use the ast.literal_eval function from the ast module to safely evaluate the string as a Python literal in encoder_decoder_functions.py:
if key == "answer_choices":
# Convert string representation of list to actual list
text = [item for sublist in ast.literal_eval(batch[key][0]) for item in sublist]
else:
text = batch[key]
The target key contains a list with a single integer element [1], which is not a valid input type for the tokenizer. The tokenizer expects a string, a list of strings, or a list of lists of strings.
To fix this, we need to ensure that the target key is handled appropriately. Since target is likely a label, we might not need to tokenize it in the same way as input and answer_choices. We have to skip tokenizing target or handle it differently in encoder_decoder_functions.py:
To fix this, we need to convert the string representation of the list into an actual list. We can use the ast.literal_eval function from the ast module to safely evaluate the string as a Python literal in encoder_decoder_functions.py:
To fix this, we need to ensure that the target key is handled appropriately. Since target is likely a label, we might not need to tokenize it in the same way as input and answer_choices. We have to skip tokenizing target or handle it differently in encoder_decoder_functions.py:
keys_to_tokenize = ["input", "answer_choices"]
...
# Handle target separately if needed if "target" in batch: tokenized_batch["target"] = batch["target"]
The text was updated successfully, but these errors were encountered: