Skip to content

Commit

Permalink
Handle string input in call method
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulooh007 committed Nov 5, 2023
1 parent cac6796 commit e43c5f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions laser_encoders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def __init__(
def __call__(self, text_or_batch):
if self.spm_model:
text_or_batch = self.tokenizer(text_or_batch)
if isinstance(text_or_batch, str):
text_or_batch = [text_or_batch]
return self.encode_sentences(text_or_batch)
else:
raise ValueError(
Expand Down

0 comments on commit e43c5f6

Please sign in to comment.