guidellm.data.entrypoints
create_data_loader(loader_config, data_config, tokenizer_config, column_mapper_config, preprocessors_config, finalizer_config, random_seed=42, console=None) async
Factory function to create a DataLoader instance based on provided configurations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loader_config | DataLoaderArgs | Configuration for the data loader. | required |
data_config | list[DataArgs] | List of configurations for dataset deserialization. | required |
tokenizer_config | DataTokenizerArgs | Configuration for the tokenizer factory. | required |
column_mapper_config | DataPreprocessorArgs | Configuration for the column mapping preprocessor. | required |
preprocessors_config | list[DataPreprocessorArgs] | List of configurations for additional preprocessors. | required |
finalizer_config | DataFinalizerArgs | Configuration for the dataset finalizer. | required |
random_seed | int | Seed for random operations to ensure reproducibility. | 42 |
console | Console | None | Optional Console instance for logging and progress display. | None |
Returns:
| Type | Description |
|---|---|
DataLoader | An instance of DataLoader configured according to the provided arguments. |
Source code in src/guidellm/data/entrypoints.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
process_dataset(data, output_path, tokenizer, strategy, data_column_mapper=None, data_loader=None, push_to_hub=False, hub_dataset_id=None, random_seed=42)
Main method to process and save a dataset with sampled prompt/output token counts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data | DataArgs | dict[str, Any] | Dataset source configuration ( | required |
output_path | str | Path | File path to save the processed dataset. | required |
tokenizer | DataTokenizerArgs | dict[str, Any] | Tokenizer configuration ( | required |
strategy | PreprocessStrategyArgs | dict[str, Any] | Preprocess strategy configuration including token targets and short-prompt handling ( | required |
data_column_mapper | DataPreprocessorArgs | dict[str, Any] | None | Optional column mapping configuration. | None |
data_loader | DataLoaderArgs | dict[str, Any] | None | Optional data loader configuration. | None |
push_to_hub | bool | Whether to push to Hugging Face Hub. | False |
hub_dataset_id | str | None | Dataset ID on Hugging Face Hub. | None |
random_seed | int | Seed for random sampling. | 42 |
Raises:
| Type | Description |
|---|---|
ValueError | If the output path is invalid or pushing conditions unmet. |