Distiset
Distiset
¶
Bases: dict
Convenient wrapper around datasets.Dataset
to push to the Hugging Face Hub.
It's a dictionary where the keys correspond to the different leaf_steps from the internal
DAG
and the values are datasets.Dataset
.
Attributes:
Name | Type | Description |
---|---|---|
pipeline_path |
Optional[Path]
|
Optional path to the pipeline.yaml file that generated the dataset. |
log_filename_path |
Optional[Path]
|
Optional path to the pipeline.log file that generated was written by the pipeline. |
Source code in src/distilabel/distiset.py
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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
push_to_hub(repo_id, private=False, token=None, generate_card=True, **kwargs)
¶
Pushes the Distiset
to the Hugging Face Hub, each dataset will be pushed as a different configuration
corresponding to the leaf step that generated it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
repo_id |
str
|
The ID of the repository to push to in the following format: |
required |
private |
bool
|
Whether the dataset repository should be set to private or not. Only affects repository creation: a repository that already exists will not be affected by that parameter. |
False
|
token |
Optional[str]
|
An optional authentication token for the Hugging Face Hub. If no token is passed, will default
to the token saved locally when logging in with |
None
|
generate_card |
bool
|
Whether to generate a dataset card or not. Defaults to True. |
True
|
**kwargs |
Any
|
Additional keyword arguments to pass to the |
{}
|
Source code in src/distilabel/distiset.py
train_test_split(train_size, shuffle=True, seed=None)
¶
Return a Distiset
whose values will be a datasets.DatasetDict
with two random train and test subsets.
Splits are created from the dataset according to train_size
and shuffle
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
train_size |
float
|
Float between |
required |
shuffle |
bool
|
Whether or not to shuffle the data before splitting |
True
|
seed |
Optional[int]
|
A seed to initialize the default BitGenerator, passed to the underlying method. |
None
|
Returns:
Type | Description |
---|---|
Distiset
|
The |
Source code in src/distilabel/distiset.py
create_distiset(data_dir, pipeline_path=None, log_filename_path=None, enable_metadata=False)
¶
Creates a Distiset
from the buffer folder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_dir |
Path
|
Folder where the data buffers were written by the |
required |
pipeline_path |
Optional[Path]
|
Optional path to the pipeline.yaml file that generated the dataset.
Internally this will be passed to the |
None
|
log_filename_path |
Optional[Path]
|
Optional path to the pipeline.log file that was generated during the pipeline run.
Internally this will be passed to the |
None
|
enable_metadata |
bool
|
Whether to include the distilabel metadata column in the dataset or not.
Defaults to |
False
|
Returns:
Type | Description |
---|---|
Distiset
|
The dataset created from the buffer folder, where the different leaf steps will |
Distiset
|
correspond to different configurations of the dataset. |