MCPcopy Index your code
hub / github.com/modelscope/modelscope / read

Method read

modelscope/fileio/file.py:264–274  ·  view source on GitHub ↗

Read data from a given ``filepath`` with 'rb' mode. Args: filepath (str or Path): Path to read data. Returns: bytes: Expected bytes object.

(uri: str)

Source from the content-addressed store, hash-verified

262
263 @staticmethod
264 def read(uri: str) -> bytes:
265 """Read data from a given ``filepath`` with 'rb' mode.
266
267 Args:
268 filepath (str or Path): Path to read data.
269
270 Returns:
271 bytes: Expected bytes object.
272 """
273 storage = File._get_storage(uri)
274 return storage.read(uri)
275
276 @staticmethod
277 def read_text(uri: Union[str, Path], encoding: str = 'utf-8') -> str:

Callers 15

get_text_annotationsMethod · 0.95
get_pluginFunction · 0.45
encode_file_to_base64Function · 0.45
_file2dictMethod · 0.45
__init__Method · 0.45
validate_py_syntaxFunction · 0.45
_load_indexFunction · 0.45
read_fileFunction · 0.45
get_file_hashFunction · 0.45
_producerFunction · 0.45
loadMethod · 0.45

Calls 1

_get_storageMethod · 0.80

Tested by 15

loadMethod · 0.36
test_dumpMethod · 0.36
get_contentMethod · 0.36
get_file_sha256Method · 0.36
test_input_bytesMethod · 0.36
wav2bytesMethod · 0.36
_import_module_textMethod · 0.36
wav2bytesMethod · 0.36
wav2bytesMethod · 0.36
test_aec_bytesMethod · 0.36