mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-31 16:07:41 +03:00 
			
		
		
		
	Use numpy.frombuffer instead of fromstring
Deprecation warning says we should do this
This commit is contained in:
		
							parent
							
								
									9a849fe54e
								
							
						
					
					
						commit
						6dd2832438
					
				|  | @ -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)) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user