Skip to content

Commit 7f81292

Browse files
committed
Merge remote-tracking branch 'upstream/main' into vision-model
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
2 parents 0339b93 + 5bb5489 commit 7f81292

16 files changed

Lines changed: 2266 additions & 206 deletions

README.md

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
- [Tuning Techniques](#tuning-techniques)
1111
- [LoRA Tuning Example](#lora-tuning-example)
1212
- [GPTQ-LoRA with AutoGPTQ Tuning Example](#gptq-lora-with-autogptq-tuning-example)
13-
- [Prompt Tuning](#prompt-tuning)
1413
- [Fine Tuning](#fine-tuning)
1514
- [FMS Acceleration](#fms-acceleration)
1615
- [Extended Pre-Training](#extended-pre-training)
@@ -755,54 +754,6 @@ Note that with LoRA tuning technique, setting `all-linear` on `target_modules` r
755754

756755
_________________________
757756

758-
### Prompt Tuning:
759-
760-
Specify `peft_method` to `'pt'` . You can additionally pass any arguments from [PromptTuningConfig](https://github.com/foundation-model-stack/fms-hf-tuning/blob/main/tuning/config/peft_config.py#L63).
761-
```py
762-
# prompt_tuning_init can be either "TEXT" or "RANDOM"
763-
prompt_tuning_init: str = "TEXT"
764-
num_virtual_tokens: int = 8
765-
# prompt_tuning_init_text only applicable if prompt_tuning_init= "TEXT"
766-
prompt_tuning_init_text: str = "Classify if the tweet is a complaint or not:"
767-
tokenizer_name_or_path: str = "llama-7b-hf"
768-
```
769-
770-
Example command you can run:
771-
772-
```bash
773-
python tuning/sft_trainer.py \
774-
--model_name_or_path $MODEL_PATH \
775-
--training_data_path $TRAIN_DATA_PATH \
776-
--output_dir $OUTPUT_PATH \
777-
--num_train_epochs 5 \
778-
--per_device_train_batch_size 1 \
779-
--learning_rate 0.03 \
780-
--response_template "\n### Label:" \
781-
--dataset_text_field "output" \
782-
--peft_method pt \
783-
--tokenizer_name_or_path $MODEL_PATH \ # This field is optional and if not specified, tokenizer from model_name_or_path will be used
784-
--prompt_tuning_init "RANDOM" \
785-
--prompt_tuning_init_text "From the following input, identify target sentiment of following types: neutral, negative, positive"
786-
```
787-
788-
Equally you can pass in a JSON configuration for running tuning. See [build doc](./build/README.md) for more details. The above can also be passed in as JSON:
789-
```json
790-
{
791-
"model_name_or_path": $MODEL_PATH,
792-
"training_data_path": $TRAIN_DATA_PATH,
793-
"output_dir": $OUTPUT_PATH,
794-
"num_train_epochs": 5.0,
795-
"per_device_train_batch_size": 1,
796-
"learning_rate": 0.03,
797-
"response_template": "\n### Label:",
798-
"dataset_text_field": "output",
799-
"peft_method": "pt",
800-
"tokenizer_name_or_path": $MODEL_PATH,
801-
"prompt_tuning_init": "RANDOM",
802-
"prompt_tuning_init_text": "From the following input, identify target sentiment of following types: neutral, negative, positive"
803-
}
804-
```
805-
806757
### Fine Tuning:
807758

808759
Set `peft_method` to `'None'` or do not provide `peft_method` flag.
@@ -1070,6 +1021,4 @@ Further details on enabling and using the trackers mentioned above can be found
10701021

10711022
## More Examples
10721023

1073-
[Prompt Tuning on Twitter Complaints](examples/prompt_tuning_twitter_complaints/README.md)
1074-
10751024
A good simple example can be found [here](examples/kfto-kueue-sft-trainer.yaml) which launches a Kubernetes-native `PyTorchJob` using the [Kubeflow Training Operator](https://github.com/kubeflow/training-operator/) with [Kueue](https://github.com/kubernetes-sigs/kueue) for the queue management of tuning jobs.

examples/prompt_tuning_twitter_complaints/README.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies = [
3434
"sentencepiece>=0.1.99,<0.3",
3535
"tokenizers>=0.13.3,<1.0",
3636
"tqdm>=4.66.2,<5.0",
37-
"trl>=0.13,<0.16",
37+
"trl>=0.13,<0.17",
3838
"peft>=0.8.0,<0.14",
3939
"protobuf>=5.28.0,<6.0.0",
4040
"datasets>=2.15.0,<4.0",

tests/artifacts/predefined_data_configs/duplicate_columns.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ datasets:
77
data_handlers:
88
- name: duplicate_columns
99
arguments:
10-
remove_columns: all
1110
batched: false
1211
fn_kwargs:
1312
old_column: "input_ids"

tests/artifacts/predefined_data_configs/skip_large_text_data_handler_template.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ datasets:
1313
dataset_text_field: "output"
1414
- name: duplicate_columns
1515
arguments:
16-
remove_columns: all
1716
batched: true
1817
fn_kwargs:
1918
old_column: "input_ids"

tests/artifacts/predefined_data_configs/tokenize_using_handler_and_train.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ datasets:
1515
max_length: 1024
1616
- name: duplicate_columns
1717
arguments:
18-
remove_columns: all
1918
batched: true
2019
fn_kwargs:
2120
old_column: "input_ids"
Binary file not shown.

0 commit comments

Comments
 (0)