Configure Parameters and Fine-Tune the Model
Configure Parameters and Fine-Tune the Model
(Optional) Modify
model_name_or_pathandtemplateinsettings.jsoncto use another locally downloaded model.Adjust
per_device_train_batch_sizeandgradient_accumulation_stepsto control VRAM usage.Depending on the quantity and quality of your dataset, you can modify the following in
train_sft_argsto fine-tune performance:num_train_epochslora_ranklora_dropout
Single-GPU Training
Run the following command to start fine-tuning with a single GPU:
weclone-cli train-sftIf you're in a multi-GPU environment but want to use only one GPU, run this command first:
export CUDA_VISIBLE_DEVICES=0Multi-GPU Training
Uncomment the
deepspeedline insettings.jsonc.Install Deepspeed:
uv pip install deepspeedStart multi-GPU training (replace
number_of_gpuswith the number of GPUs you want to use):
Run Web Demo for Inference
You can use this step to test appropriate temperature and top_p values, and then update the infer_args in settings.jsonc for future inference.
Run API Server for Inference
Test with Common Chat Scenarios
These test cases exclude any personal information inquiries, and focus on everyday conversations.
Test results will be saved to test_result-my.txt.
Last updated