Skip to content

Commit

Permalink
add gc
Browse files Browse the repository at this point in the history
  • Loading branch information
nesasio93 committed Oct 7, 2023
1 parent efff472 commit 3a9c5e3
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions spkatt-2023.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"from tqdm import tqdm\n",
"import json\n",
"import warnings\n",
"import gc\n",
"import torch\n",
"\n",
"from datasets import (\n",
" load_dataset,\n",
Expand Down Expand Up @@ -1647,6 +1649,42 @@
"- `save_steps` and `max_steps`: set `max_steps` to control the length of training (`save_steps` determines when checkpoints are created)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# choose config for cue model\n",
"cues_training_config = \"./configs/7b_cues.args\" # 7b model\n",
"# cues_training_config = \"./configs/70b_cues.args\" # 70b model\n",
"\n",
"train(cues_training_config)\n",
"\n",
"# free vram after training\n",
"gc.collect()\n",
"torch.cuda.empty_cache()\n",
"gc.collect()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# choose config for roles model\n",
"roles_training_config = \"./configs/7b_roles.args\" # 7b model\n",
"# roles_training_config = \"./configs/70b_roles.args\" # 70b model\n",
"\n",
"train(roles_training_config)\n",
"\n",
"# free vram after training\n",
"gc.collect()\n",
"torch.cuda.empty_cache()\n",
"gc.collect()"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit 3a9c5e3

Please sign in to comment.