Skip to content

Commit

Permalink
fix sentence piece input reader byte string (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyxinyiwang authored and msperber committed Jul 9, 2018
1 parent 753f246 commit 6fbbba4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions xnmt/input_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def read_sent(self, sentence):
words = self.subword_model.SampleEncodeAsPieces(sentence.strip(), self.l, self.alpha)
else:
words = self.subword_model.EncodeAsPieces(sentence.strip())
words = [w.decode('utf-8') for w in words]
return SimpleSentenceInput([self.vocab.convert(word) for word in words] + \
[self.vocab.convert(Vocab.ES_STR)], vocab_reference)

Expand Down

0 comments on commit 6fbbba4

Please sign in to comment.