mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +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.
|
||||
if 'user_data' not in exclude and 'user_data_keys' in msg:
|
||||
user_data_keys = msgpack.loads(msg['user_data_keys'],
|
||||
use_list=False)
|
||||
user_data_values = msgpack.loads(msg['user_data_values'])
|
||||
use_list=False, raw=False)
|
||||
user_data_values = msgpack.loads(msg['user_data_values'], raw=False)
|
||||
for key, value in zip(user_data_keys, user_data_values):
|
||||
self.user_data[key] = value
|
||||
|
||||
|
|
|
@ -487,7 +487,7 @@ def to_bytes(getters, 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():
|
||||
if key not in exclude and key in msg:
|
||||
setter(msg[key])
|
||||
|
|
Loading…
Reference in New Issue
Block a user