Torch Object Storage
Parameter | Required | Type | Example value | Description |
Parameter | Required | Type | Example value | Description |
urls | Yes | str | Iterator[str] | ['tos://bucket/key1', 'tos://bucket/key2'] | Format for a single URL: tos://{bucketname}/{objectname}. |
prefix | Yes | str | tos://bucket/prefix | Format: tos://{bucketname}/{prefix}. |
region | Yes | str | cn-beijing | TOS region ID. |
endpoint | No | str | http://tos-cn-beijing.volces.com | TOS endpoint. |
transform | No | Callable[[TosObjectReader], Any] | def transform(item): data = item.read() return item.key, item.size | Transformation function. |
cred | No | CredentialProvider | CredentialProvider('ak', 'sk') | Used to pass credentials. |
client_conf | No | TosClientConfig | - | Used to configure the connector. |
sharding | No | bool | True | Specify whether to share data between worker processes. |
reader_type | No | ReaderType | ReaderType.RANGED | The reader type for TosObjectReader. Possible values:
|
buffer_size | No | int | 8388608 | The size of a cache block. This parameter is only valid when ReaderType is ReaderType.RANGED. |
enable_crc | No | bool | True | Specify whether to check data integrity for uploads and sequential reads. |
prefetch_concurrency | No | int | 32 | The number of concurrent reads when preloading the dataset. |