Skip to content

Commit 087c63c

Browse files
committed
Document Sync by Tina
1 parent 5768e66 commit 087c63c

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

docs/stable/cli/cli_api.md

+77
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,80 @@ sllm-cli update [OPTIONS]
265265
sllm-cli update --model facebook/opt-1.3b
266266
sllm-cli update --config /path/to/config.json
267267
```
268+
269+
### sllm-cli fine-tuning
270+
Fine-tuning the deployed model.
271+
272+
##### Usage
273+
```bash
274+
sllm-cli fine-tuning [OPTIONS]
275+
```
276+
277+
##### Options
278+
- `--base_model <model_name>`
279+
- Base model name to be fine-tuned
280+
- `--config <config_path>`
281+
- Path to the JSON configuration file.
282+
283+
##### Example
284+
```bash
285+
sllm-cli fine-tuning --base_model <model_name>
286+
sllm-cli fine-tuning --base_model <model_name> --config <path_to_ft_config_file>
287+
```
288+
289+
##### Example Configuration File (`ft_config.json`)
290+
```json
291+
{
292+
"model": "bigscience/bloomz-560m",
293+
"ft_backend": "peft",
294+
"dataset_config": {
295+
"dataset_source": "hf_hub",
296+
"hf_dataset_name": "fka/awesome-chatgpt-prompts",
297+
"tokenization_field": "prompt",
298+
"split": "train[:10%]",
299+
"data_files": "",
300+
"extension_type": ""
301+
},
302+
"lora_config": {
303+
"r": 4,
304+
"lora_alpha": 1,
305+
"target_modules": ["query_key_value"],
306+
"lora_dropout": 0.05,
307+
"bias": "lora_only",
308+
"task_type": "CAUSAL_LM"
309+
},
310+
"training_config": {
311+
"auto_find_batch_size": true,
312+
"num_train_epochs": 2,
313+
"learning_rate": 0.0001,
314+
"use_cpu": false
315+
}
316+
}
317+
```
318+
319+
Below is a description of all the fields in ft_config.json.
320+
321+
| Field | Description |
322+
|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
323+
| model | This should be a deployed model name, used to identify the backend instance. |
324+
| ft_backend | fine-tuning engine, only support `peft` now. |
325+
| dataset_config | Config about the fine-tuning dataset |
326+
| dataset_config.dataset_source | dataset is from `hf_hub` (huggingface_hub) or `local` file |
327+
| dataset_config.hf_dataset_name | dataset name on huggingface_hub |
328+
| dataset_config.tokenization_field | the field to tokenize |
329+
| dataset_config.split | Partitioning of the dataset (`train`, `validation` and `test`), You can also split the selected dataset, e.g. take only the top 10% of the training data: train[:10%] |
330+
| dataset_config.data_files | data files will be loaded from local |
331+
| dataset_config.extension_type | extension type of data files (`csv`, `json`, `parquet`, `arrow`) |
332+
| lora_config | Config about lora |
333+
| lora_config.r | `r` defines how many parameters will be trained. |
334+
| lora_config.lora_alpha | A multiplier controlling the overall strength of connections within a neural network, typically set at 1 |
335+
| lora_config.target_modules | a list of the target_modules available on the [Hugging Face Documentation](https://github.com/huggingface/peft/blob/39ef2546d5d9b8f5f8a7016ec10657887a867041/src/peft/utils/other.py#L220) |
336+
| lora_config.lora_dropout | used to avoid overfitting |
337+
| lora_config.bias | use `none` or `lora_only` |
338+
| lora_config.task_type | Indicates the task the model is begin trained for |
339+
| training_config | Config about training parameters |
340+
| training_config.auto_find_batch_size | Find a correct batch size that fits the size of Data. |
341+
| training_config.num_train_epochs | Total number of training rounds |
342+
| training_config.learning_rate | learning rate |
343+
| training_config.optim | select an optimiser |
344+
| training_config.use_cpu | if use cpu to train |

0 commit comments

Comments
 (0)