MCPcopy Create free account
hub / github.com/modelscope/modelscope / read

Method read

modelscope/hub/commit_scheduler.py:372–381  ·  view source on GitHub ↗

Read at most _size bytes from the current position.

(self, __size: Optional[int] = -1)

Source from the content-addressed store, hash-verified

370 return pos
371
372 def read(self, __size: Optional[int] = -1) -> bytes:
373 """Read at most _size bytes from the current position."""
374 current = self.tell()
375 if __size is None or __size < 0:
376 # Read until file limit
377 truncated_size = self._size_limit - current
378 else:
379 # Read until file limit or __size
380 truncated_size = min(__size, self._size_limit - current)
381 return self._file.read(truncated_size)

Calls 1

tellMethod · 0.95