Skip to content

Commit

Permalink
use bytes object like in other methods
Browse files Browse the repository at this point in the history
  • Loading branch information
vrasneur committed Sep 2, 2017
1 parent 57ebcf0 commit 1e68f3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pyfasttext.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,12 @@ cdef class FastText:

def train(self, command, **kwargs):
cdef vector[string] args
args.push_back('fastText'.encode(self.encoding))
args.push_back(command.encode(self.encoding))
args.push_back(bytes('fastText', self.encoding))
args.push_back(bytes(command, self.encoding))

for key, val in kwargs.items():
args.push_back(('-' + key).encode(self.encoding))
args.push_back(str(val).encode(self.encoding))
args.push_back(bytes('-' + key, self.encoding))
args.push_back(bytes(str(val), self.encoding))

cdef shared_ptr[Args] s_args = make_shared[Args]()

Expand Down

0 comments on commit 1e68f3c

Please sign in to comment.