We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b03c9c7 commit f7fda2bCopy full SHA for f7fda2b
tuning/utils/data_loaders.py
@@ -109,6 +109,11 @@ def __iter__(self):
109
sample[self.tokens_field] = self.tokenizer.encode(
110
sample[self.text_field]
111
)
112
+ if not sample[self.tokens_field]:
113
+ logger.warning(
114
+ f"skipping an empty sample : {sample[self.tokens_field]}"
115
+ )
116
+ continue
117
except Exception as e: # pylint: disable=broad-exception-caught
118
logger.warning(
119
"failed to tokenize the data {} of type {}.".format(
0 commit comments