mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
parent
11fdde0271
commit
b28b537131
@ -427,9 +427,14 @@ class PreTrainedTokenizer(PreTrainedTokenizerBase):
|
||||
elif isinstance(text, (list, tuple)) and len(text) > 0 and isinstance(text[0], int):
|
||||
return text
|
||||
else:
|
||||
raise ValueError(
|
||||
f"Input {text} is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers."
|
||||
)
|
||||
if is_pretokenized:
|
||||
raise ValueError(
|
||||
f"Input {text} is not valid. Should be a string or a list/tuple of strings when `is_pretokenized=True`."
|
||||
)
|
||||
else:
|
||||
raise ValueError(
|
||||
f"Input {text} is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers."
|
||||
)
|
||||
|
||||
if return_offsets_mapping:
|
||||
raise NotImplementedError(
|
||||
|
Loading…
Reference in New Issue
Block a user