Skip to content

Commit

Permalink
fix selfies reader
Browse files Browse the repository at this point in the history
  • Loading branch information
sfluegel committed Nov 29, 2023
1 parent fe6c3f0 commit 8bf268a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chebai/preprocessing/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ def name(cls):

def _read_data(self, raw_data):
try:
tokenized = sf.split_selfies(sf.encoder(raw_data, strict=True))
tokenized = sf.split_selfies(sf.encoder(raw_data.strip(), strict=True))
tokenized = [self._get_token_index(v) for v in tokenized]
except Exception as e:
print(f'could not process {raw_data} (type: {type(raw_data)}')
print(f'could not process {raw_data}')
print(f'\t{e}')
self.error_count += 1
print(f'\terror count: {self.error_count}')
Expand Down

0 comments on commit 8bf268a

Please sign in to comment.