4040from PIL import Image
4141
4242AUTOTUNE = tf .data .experimental .AUTOTUNE
43-
43+ os . environ [ "TOKENIZERS_PARALLELISM" ] = "false"
4444
4545def make_data_iterator (
4646 config ,
@@ -159,7 +159,7 @@ def make_dreambooth_train_iterator(config, mesh, global_batch_size, tokenizer, v
159159 function = tokenize_fn ,
160160 batched = True ,
161161 remove_columns = [INSTANCE_PROMPT_IDS ],
162- num_proc = 1 ,
162+ num_proc = None ,
163163 desc = "Running tokenizer on instance dataset" ,
164164 )
165165 rng = jax .random .key (config .seed )
@@ -177,7 +177,7 @@ def make_dreambooth_train_iterator(config, mesh, global_batch_size, tokenizer, v
177177 function = transform_images_fn ,
178178 batched = True ,
179179 remove_columns = [INSTANCE_IMAGES ],
180- num_proc = 1 ,
180+ num_proc = None ,
181181 desc = "Running vae on instance dataset" ,
182182 )
183183
@@ -188,7 +188,7 @@ def make_dreambooth_train_iterator(config, mesh, global_batch_size, tokenizer, v
188188 function = tokenize_fn ,
189189 batched = True ,
190190 remove_columns = [CLASS_PROMPT_IDS ],
191- num_proc = 1 ,
191+ num_proc = None ,
192192 desc = "Running tokenizer on class dataset" ,
193193 )
194194 transform_images_fn = partial (
@@ -204,7 +204,7 @@ def make_dreambooth_train_iterator(config, mesh, global_batch_size, tokenizer, v
204204 function = transform_images_fn ,
205205 batched = True ,
206206 remove_columns = [CLASS_IMAGES ],
207- num_proc = 1 ,
207+ num_proc = None ,
208208 desc = "Running vae on instance dataset" ,
209209 )
210210
0 commit comments