Skip to content

Commit 99ba2cb

Browse files
committed
Updating the jupyter notebooks to remove the manual pruning step.
1 parent f7c00e9 commit 99ba2cb

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

dreambooth_colab_joepenna.ipynb

+2-4
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,15 @@
214214
{
215215
"cell_type": "code",
216216
"source": [
217-
"#@title # Prune the Model\n",
217+
"#@title # Copy and name the checkpoint file\n",
218218
"\n",
219219
"directory_paths = !ls -d logs/*\n",
220220
"last_checkpoint_file = directory_paths[-1] + \"/checkpoints/last.ckpt\"\n",
221-
"!python \"prune_ckpt.py\" --ckpt {last_checkpoint_file}\n",
222-
"last_checkpoint_file_pruned = directory_paths[-1] + \"/checkpoints/last-pruned.ckpt\"\n",
223221
"training_images = !find training_images/*\n",
224222
"date_string = !date +\"%Y-%m-%dT%H-%M-%S\"\n",
225223
"file_name = date_string[-1] + \"_\" + project_name + \"_\" + str(len(training_images)) + \"_training_images_\" + str(max_training_steps) + \"_max_training_steps_\" + token + \"_token_\" + class_word + \"_class_word.ckpt\"\n",
226224
"!mkdir -p trained_models\n",
227-
"!mv {last_checkpoint_file_pruned} trained_models/{file_name}\n",
225+
"!mv {last_checkpoint_file} trained_models/{file_name}\n",
228226
"\n",
229227
"print(\"Download your trained model file from trained_models/\" + file_name + \" and use in your favorite Stable Diffusion repo!\")"
230228
],

dreambooth_runpod_joepenna.ipynb

+3-6
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,7 @@
364364
"id": "dc49d0bd",
365365
"metadata": {},
366366
"source": [
367-
"## Pruning (12GB to 2GB)\n",
368-
"We are working on having this happen automatically (TODO: PR's welcome)"
367+
"## Copy and name the checkpoint file"
369368
]
370369
},
371370
{
@@ -376,17 +375,15 @@
376375
},
377376
"outputs": [],
378377
"source": [
379-
"# Prune the Model\n",
378+
"# Copy the checkpoint into our `trained_models` folder\n",
380379
"\n",
381380
"directory_paths = !ls -d logs/*\n",
382381
"last_checkpoint_file = directory_paths[-1] + \"/checkpoints/last.ckpt\"\n",
383-
"!python \"prune_ckpt.py\" --ckpt {last_checkpoint_file}\n",
384-
"last_checkpoint_file_pruned = directory_paths[-1] + \"/checkpoints/last-pruned.ckpt\"\n",
385382
"training_images = !find training_images/*\n",
386383
"date_string = !date +\"%Y-%m-%dT%H-%M-%S\"\n",
387384
"file_name = date_string[-1] + \"_\" + project_name + \"_\" + str(len(training_images)) + \"_training_images_\" + str(max_training_steps) + \"_max_training_steps_\" + token + \"_token_\" + class_word + \"_class_word.ckpt\"\n",
388385
"!mkdir -p trained_models\n",
389-
"!mv {last_checkpoint_file_pruned} trained_models/{file_name}\n",
386+
"!mv {last_checkpoint_file} trained_models/{file_name}\n",
390387
"\n",
391388
"print(\"Download your trained model file from trained_models/\" + file_name + \" and use in your favorite Stable Diffusion repo!\")"
392389
]

0 commit comments

Comments
 (0)