Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Str to byte fix for DTM wrapper. #768

Merged
merged 3 commits into from
Jul 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gensim/models/wrappers/dtmmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ def convert_input(self, corpus, time_slices):
corpora.BleiCorpus.save_corpus(self.fcorpustxt(), corpus)

with utils.smart_open(self.ftimeslices(), 'wb') as fout:
fout.write(six.u(str(len(self.time_slices)) + "\n"))
fout.write(six.u(utils.to_utf8(str(len(self.time_slices)) + "\n")))
Copy link
Owner

@piskvorky piskvorky Jul 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get this. Doesn't six.u return unicode? How does this work @tmylk ?

for sl in time_slices:
fout.write(six.u(str(sl) + "\n"))
fout.write(six.u(utils.to_utf8(str(sl) + "\n")))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtto


def train(self, corpus, time_slices, mode, model):
"""
Expand Down