mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
* Remove explicit bytes type in doc.from_bytes, to accept bytearray
This commit is contained in:
parent
aa28e2e01d
commit
2060935cdb
|
@ -298,7 +298,7 @@ cdef class Doc:
|
||||||
byte_string = self.vocab.serializer.pack(self)
|
byte_string = self.vocab.serializer.pack(self)
|
||||||
return struct.pack('I', len(byte_string)) + byte_string
|
return struct.pack('I', len(byte_string)) + byte_string
|
||||||
|
|
||||||
def from_bytes(self, bytes data):
|
def from_bytes(self, data):
|
||||||
self.vocab.serializer.unpack_into(data[4:], self)
|
self.vocab.serializer.unpack_into(data[4:], self)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user