Skip to content

Commit 1aeef96

Browse files
committed
COMPAT: str -> bytes
1 parent 818ea77 commit 1aeef96

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mrec/base_recommender.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def save(self,filepath):
8888
if archive:
8989
np.savez(filepath,**archive)
9090
else:
91-
pickle.dump(self,open(filepath,'w'))
91+
pickle.dump(self,open(filepath,'wb'))
9292

9393
def _create_archive(self):
9494
"""
@@ -119,7 +119,7 @@ def load(filepath):
119119
if isinstance(r,BaseRecommender):
120120
model = r
121121
else:
122-
model = np.loads(str(r['model']))
122+
model = np.loads(r['model'])
123123
model._load_archive(r) # restore any fields serialized separately
124124
return model
125125

@@ -150,7 +150,7 @@ def read_recommender_description(filepath):
150150
if isinstance(r,BaseRecommender):
151151
model = r
152152
else:
153-
model = np.loads(str(r['model']))
153+
model = np.loads(r['model'])
154154
return str(model)
155155

156156
def __str__(self):

0 commit comments

Comments
 (0)