Skip to content

Commit

Permalink
fix colabs
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekkrthakur committed May 6, 2024
1 parent f88ed82 commit f33a71e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion colabs/AutoTrain_Dreambooth.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"#@markdown You can find your token here: https://huggingface.co/settings/tokens\n",
"push_to_hub = False # @param [\"False\", \"True\"] {type:\"raw\"}\n",
"hf_token = \"hf_XXX\" #@param {type:\"string\"}\n",
"hf_username = \"abc\" #@param {type:\"string\"}\n",
"\n",
"#@markdown ---\n",
"#@markdown #### Hyperparameters\n",
Expand Down Expand Up @@ -80,7 +81,8 @@
"os.environ[\"USE_XFORMERS\"] = str(use_xformers)\n",
"os.environ[\"MIXED_PRECISION\"] = str(mixed_precision)\n",
"os.environ[\"TRAIN_TEXT_ENCODER\"] = str(train_text_encoder)\n",
"os.environ[\"DISABLE_GRADIENT_CHECKPOINTING\"] = str(disable_gradient_checkpointing)"
"os.environ[\"DISABLE_GRADIENT_CHECKPOINTING\"] = str(disable_gradient_checkpointing)\n",
"os.environ[\"HF_USERNAME\"] = hf_username"
]
},
{
Expand All @@ -107,6 +109,7 @@
"--gradient-accumulation ${GRADIENT_ACCUMULATION} \\\n",
"--lr ${LEARNING_RATE} \\\n",
"--mixed-precision ${MIXED_PRECISION} \\\n",
"--username ${HF_USERNAME} \\\n",
"$( [[ \"$USE_XFORMERS\" == \"True\" ]] && echo \"--xformers\" ) \\\n",
"$( [[ \"$TRAIN_TEXT_ENCODER\" == \"True\" ]] && echo \"--train-text-encoder\" ) \\\n",
"$( [[ \"$USE_8BIT_ADAM\" == \"True\" ]] && echo \"--use-8bit-adam\" ) \\\n",
Expand Down
9 changes: 7 additions & 2 deletions colabs/AutoTrain_LLM.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@
"#@markdown You can find your token here: https://huggingface.co/settings/tokens\n",
"push_to_hub = False # @param [\"False\", \"True\"] {type:\"raw\"}\n",
"hf_token = \"hf_XXX\" #@param {type:\"string\"}\n",
"hf_username = \"abc\" #@param {type:\"string\"}\n",
"\n",
"#@markdown ---\n",
"#@markdown #### Hyperparameters\n",
"learning_rate = 2e-4 # @param {type:\"number\"}\n",
"num_epochs = 1 #@param {type:\"number\"}\n",
"batch_size = 1 # @param {type:\"slider\", min:1, max:32, step:1}\n",
"block_size = 1024 # @param {type:\"number\"}\n",
"trainer = \"sft\" # @param [\"default\", \"sft\"] {type:\"raw\"}\n",
"trainer = \"sft\" # @param [\"default\", \"sft\", \"orpo\"] {type:\"raw\"}\n",
"warmup_ratio = 0.1 # @param {type:\"number\"}\n",
"weight_decay = 0.01 # @param {type:\"number\"}\n",
"gradient_accumulation = 4 # @param {type:\"number\"}\n",
Expand All @@ -83,7 +84,9 @@
"os.environ[\"QUANTIZATION\"] = str(quantization)\n",
"os.environ[\"LORA_R\"] = str(lora_r)\n",
"os.environ[\"LORA_ALPHA\"] = str(lora_alpha)\n",
"os.environ[\"LORA_DROPOUT\"] = str(lora_dropout)"
"os.environ[\"LORA_DROPOUT\"] = str(lora_dropout)\n",
"os.environ[\"HF_USERNAME\"] = hf_username\n",
"os.environ[\"TRAINER\"] = trainer"
]
},
{
Expand Down Expand Up @@ -113,6 +116,8 @@
"--gradient-accumulation ${GRADIENT_ACCUMULATION} \\\n",
"--quantization ${QUANTIZATION} \\\n",
"--mixed-precision ${MIXED_PRECISION} \\\n",
"--username ${HF_USERNAME} \\\n",
"--trainer ${TRAINER} \\\n",
"$( [[ \"$PEFT\" == \"True\" ]] && echo \"--peft\" ) \\\n",
"$( [[ \"$PUSH_TO_HUB\" == \"True\" ]] && echo \"--push-to-hub --token ${HF_TOKEN}\" )"
]
Expand Down

0 comments on commit f33a71e

Please sign in to comment.