mirror of https://github.com/explosion/spaCy.git
Fiddle with msgpack bytes vs unicode
This commit is contained in:
parent
1bebc6392c
commit
1d18cedae8
|
@ -423,11 +423,11 @@ def to_bytes(getters, exclude):
|
|||
for key, getter in getters.items():
|
||||
if key not in exclude:
|
||||
serialized[key] = getter()
|
||||
return msgpack.dumps(serialized)
|
||||
return msgpack.dumps(serialized, use_bin_type=True, encoding='utf8')
|
||||
|
||||
|
||||
def from_bytes(bytes_data, setters, exclude):
|
||||
msg = msgpack.loads(bytes_data)
|
||||
msg = msgpack.loads(bytes_data, encoding='utf8')
|
||||
for key, setter in setters.items():
|
||||
if key not in exclude:
|
||||
setter(msg[key])
|
||||
|
|
Loading…
Reference in New Issue