mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
Fix msgpack for new version
This commit is contained in:
parent
899f1cf442
commit
e0caf3ae8c
|
@ -828,8 +828,8 @@ cdef class Doc:
|
||||||
# users don't mind getting a list instead of a tuple.
|
# users don't mind getting a list instead of a tuple.
|
||||||
if 'user_data' not in exclude and 'user_data_keys' in msg:
|
if 'user_data' not in exclude and 'user_data_keys' in msg:
|
||||||
user_data_keys = msgpack.loads(msg['user_data_keys'],
|
user_data_keys = msgpack.loads(msg['user_data_keys'],
|
||||||
use_list=False)
|
use_list=False, raw=False)
|
||||||
user_data_values = msgpack.loads(msg['user_data_values'])
|
user_data_values = msgpack.loads(msg['user_data_values'], raw=False)
|
||||||
for key, value in zip(user_data_keys, user_data_values):
|
for key, value in zip(user_data_keys, user_data_values):
|
||||||
self.user_data[key] = value
|
self.user_data[key] = value
|
||||||
|
|
||||||
|
|
|
@ -487,7 +487,7 @@ def to_bytes(getters, exclude):
|
||||||
|
|
||||||
|
|
||||||
def from_bytes(bytes_data, setters, exclude):
|
def from_bytes(bytes_data, setters, exclude):
|
||||||
msg = msgpack.loads(bytes_data, encoding='utf8')
|
msg = msgpack.loads(bytes_data, raw=False)
|
||||||
for key, setter in setters.items():
|
for key, setter in setters.items():
|
||||||
if key not in exclude and key in msg:
|
if key not in exclude and key in msg:
|
||||||
setter(msg[key])
|
setter(msg[key])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user