Skip to content

Instantly share code, notes, and snippets.

@Sirsirious
Last active February 4, 2020 18:51
Show Gist options
  • Save Sirsirious/60faa47e8390c26e67d1cdb24667051b to your computer and use it in GitHub Desktop.
Save Sirsirious/60faa47e8390c26e67d1cdb24667051b to your computer and use it in GitHub Desktop.
To iterate our DummyTokenizer
def __iter__(self):
return self
def __next__(self):
if self._index < len(self.tokens):
result = self.tokens[self._index]
self._index+=1
return result
raise StopIteration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment