Skip to main content

Finetune CLI


The following are the CLI commands for ScaleGenAI Finetuning.

FunctionDescription
createLaunch a fine-tuning job.
listList launched fine-tuning jobs.
stopStop a running job.
viewView a fine-tuning job.

create

Run this command to create a finetuning job.

scalegen finetune create [args]

The following is the list of arguments that the command requires:

  • task : str [ llm | seq2seq | text_classification ] : Specify the task type
  • job_name : str : Specify the name for the job
  • artifacts_storage : str : Select the results store
  • use_spot : boolean : Specify whether or not spot instances are to be used
  • model : str : HuggingFace model [required]
  • data_path : str : HuggingFace data path or Virtual Mount to be used [required]
  • train_subset : str : Training data subset to use
  • text_column : str : Text column to use
  • lr : float : Learning rate to use
  • epochs : int : Number of training epochs
  • batch_size : int : Training batch size to use
  • use_peft : boolean : Whether or not to use PEFT
  • wandb_key : str : Use experiment tracking with WANDB [required]
  • mixed_precision : str [ fp16 | bf16 ] : Mixed precision type to use
  • quantization : str [ int4 | int8 ] : Quantization type to use
  • disable_gradient_checkpointing : boolean : Disable gradient checkpointing
  • use_flash_attention_2 : boolean : Use flash attention 2
  • lora_r : int : Lora r to use
  • lora_alpha : int : Lora alpha to use
  • lora_dropout : float : Lora dropout to use
  • gradient_accumulation_steps : int : Gradient accumulation steps to use
  • help

Example

scalegen finetune create \
--model "mistralai/Mistral-7B-Instruct-v0.2" \
--data_path "centroIA/MistralInstructScenarios" \
--use_peft \
--epochs 220 \
--batch_size 8 \
--lr 0.001 \
--quantization int4 \
--lora_r 8 \
--mixed_precision fp16 \
--wandb_key your1wandb1api1key

list

Run this command to list your running finetuning jobs.

scalegen finetune list

To list all the jobs, use the -a or --all flag

scalegen finetune list -a

stop

Run this command to stop a running finetuning jobs.

scalegen finetune stop <JOB_ID>

Example

scalegen finetune stop test_job

view

View the status and logs associated with a job.

scalegen finetune view <JOB_ID>

Example

scalegen finetune view test_job