pender / chatbot-rnn

A toy chatbot powered by deep learning and trained on data from Reddit
MIT License
899 stars 370 forks source link

TypeError: a bytes-like object is required, not 'str' #33

Closed boardem closed 6 years ago

boardem commented 6 years ago

\chatbot.py", line 60, in sample_main

saved_args = cPickle.load(f)

TypeError: a bytes-like object is required, not 'str'

ouken0 commented 6 years ago

Same issue here, though I have updated the import method to: import pickle to bypass import errors after easy_install --upgrade six

also updated the below: saved_args = pickle.load(f) chars, vocab = pickle.load(f)

any ideas on this error/import issue?

ouken0 commented 6 years ago

Found out it was a syntax issue, The following example reads the resulting pickled data.

import pickle

with open('data.pickle', 'rb') as f:
    # The protocol version used is detected automatically, so we do not have to specify it.
    data = pickle.load(f)

for me it would be:

pender commented 6 years ago

Hi, I pushed a significant update to TF 1.4 and Python3, so I am closing out old issues -- feel free to reopen if this is still a problem, and I can take a look.

ouken0 commented 6 years ago

works like a charm, but quit offensive with reddit data, I am looking alternative training data.

and that's the actual key differentiator, Data Quality. Maybe also training time.

But thanks for the update @pender 👍

ButterscotchV commented 6 years ago

Something you could do is quickly make a net to separate offensive posts from non-offensive posts in the data, or just make it filter out specific words and phrases. I personally think that the bot being offensive makes it feel more realistic, as people on the internet are often offensive.

ouken0 commented 6 years ago

Yes @Dankrushen , I actually made a formal apology to the bot "on behalf of all the humans", as the quality of it's training data is realistic, and this is really how an alien or a human from the future would see us "based on our output". There is a lot of anger out there.

But on the other hand, there are better sets of data, I am looking at "United States Supreme Court oral argument", i am just a bit lazy on training the model myself, i would absolutely love to have a pre-trained model with a "business-like" conversation data.

I am also looking to implement a net but for long term memory, to store long-term Bot values "like name, location, feelings".

ButterscotchV commented 6 years ago

That would be cool, you should let me know if you do!