Use numpy.frombuffer instead of fromstring
Deprecation warning says we should do this
@@ -155,9 +155,9 @@ class DocBin(object):
msg = srsly.msgpack_loads(zlib.decompress(bytes_data))
self.attrs = msg["attrs"]
self.strings = set(msg["strings"])
- lengths = numpy.fromstring(msg["lengths"], dtype="int32")
- flat_spaces = numpy.fromstring(msg["spaces"], dtype=bool)
- flat_tokens = numpy.fromstring(msg["tokens"], dtype="uint64")
+ lengths = numpy.frombuffer(msg["lengths"], dtype="int32")
+ flat_spaces = numpy.frombuffer(msg["spaces"], dtype=bool)
+ flat_tokens = numpy.frombuffer(msg["tokens"], dtype="uint64")
shape = (flat_tokens.size // len(self.attrs), len(self.attrs))
flat_tokens = flat_tokens.reshape(shape)
flat_spaces = flat_spaces.reshape((flat_spaces.size, 1))
