vllm.transformers_utils.s3_utils
S3Model ¶
A class representing a S3 model mirrored into a temporary directory.
Attributes:
Name | Type | Description |
---|---|---|
s3 | S3 client. | |
dir | The temporary created directory. |
Methods:
Name | Description |
---|---|
pull_files | Pull model from S3 to the temporary directory. |
Source code in vllm/transformers_utils/s3_utils.py
__del__ ¶
__init__ ¶
Source code in vllm/transformers_utils/s3_utils.py
_close ¶
_close_by_signal ¶
pull_files ¶
pull_files(
s3_model_path: str = "",
allow_pattern: Optional[list[str]] = None,
ignore_pattern: Optional[list[str]] = None,
) -> None
Pull files from S3 storage into the temporary directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s3_model_path | str | The S3 path of the model. | '' |
allow_pattern | Optional[list[str]] | A list of patterns of which files to pull. | None |
ignore_pattern | Optional[list[str]] | A list of patterns of which files not to pull. | None |
Source code in vllm/transformers_utils/s3_utils.py
_filter_allow ¶
_filter_ignore ¶
glob ¶
List full file names from S3 path and filter by allow pattern.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s3 | S3 client to use. | None | |
path | str | The S3 path to list from. | '' |
allow_pattern | Optional[list[str]] | A list of patterns of which files to pull. | None |
Returns:
Type | Description |
---|---|
list[str] | list[str]: List of full S3 paths allowed by the pattern |
Source code in vllm/transformers_utils/s3_utils.py
list_files ¶
list_files(
s3,
path: str,
allow_pattern: Optional[list[str]] = None,
ignore_pattern: Optional[list[str]] = None,
) -> tuple[str, str, list[str]]
List files from S3 path and filter by pattern.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s3 | S3 client to use. | required | |
path | str | The S3 path to list from. | required |
allow_pattern | Optional[list[str]] | A list of patterns of which files to pull. | None |
ignore_pattern | Optional[list[str]] | A list of patterns of which files not to pull. | None |
Returns:
Type | Description |
---|---|
tuple[str, str, list[str]] | tuple[str, str, list[str]]: A tuple where: - The first element is the bucket name - The second element is string represent the bucket and the prefix as a dir like string - The third element is a list of files allowed or disallowed by pattern |