From 5e0160cc1a9aacc989b9fb2ee42cdba8eadfa544 Mon Sep 17 00:00:00 2001 From: Abhishek Thakur Date: Thu, 23 May 2024 13:48:53 +0200 Subject: [PATCH] update configs --- configs/llm_finetuning/gpt2_sft.yml | 3 +-- configs/llm_finetuning/llama3-70b-orpo-v1.yml | 3 +-- configs/llm_finetuning/llama3-70b-sft.yml | 3 +-- configs/llm_finetuning/llama3-8b-dpo-qlora.yml | 3 +-- configs/llm_finetuning/llama3-8b-orpo-space.yml | 3 +-- configs/llm_finetuning/llama3-8b-orpo.yml | 3 +-- src/autotrain/__init__.py | 2 +- src/autotrain/app/params.py | 3 ++- src/autotrain/parser.py | 13 +++++++++++-- 9 files changed, 20 insertions(+), 16 deletions(-) diff --git a/configs/llm_finetuning/gpt2_sft.yml b/configs/llm_finetuning/gpt2_sft.yml index 24e054d6cd..44160ce58b 100644 --- a/configs/llm_finetuning/gpt2_sft.yml +++ b/configs/llm_finetuning/gpt2_sft.yml @@ -1,4 +1,4 @@ -task: llm +task: llm-sft base_model: openai-community/gpt2 project_name: autotrain-gpt2-finetuned-guanaco log: tensorboard @@ -13,7 +13,6 @@ data: text_column: text params: - trainer: sft block_size: 1024 model_max_length: 2048 max_prompt_length: 512 diff --git a/configs/llm_finetuning/llama3-70b-orpo-v1.yml b/configs/llm_finetuning/llama3-70b-orpo-v1.yml index 33861aa455..e98a6d8382 100644 --- a/configs/llm_finetuning/llama3-70b-orpo-v1.yml +++ b/configs/llm_finetuning/llama3-70b-orpo-v1.yml @@ -1,4 +1,4 @@ -task: llm +task: llm-orpo base_model: meta-llama/Meta-Llama-3-70B-Instruct project_name: autotrain-llama3-70b-orpo-v1 log: tensorboard @@ -15,7 +15,6 @@ data: prompt_text_column: prompt params: - trainer: orpo block_size: 2048 model_max_length: 8192 max_prompt_length: 1024 diff --git a/configs/llm_finetuning/llama3-70b-sft.yml b/configs/llm_finetuning/llama3-70b-sft.yml index 26173a0a69..bae67b1e2f 100644 --- a/configs/llm_finetuning/llama3-70b-sft.yml +++ b/configs/llm_finetuning/llama3-70b-sft.yml @@ -1,4 +1,4 @@ -task: llm +task: llm-sft base_model: meta-llama/Meta-Llama-3-70B-Instruct project_name: autotrain-llama3-70b-math-v1 log: tensorboard @@ -13,7 +13,6 @@ data: text_column: text params: - trainer: sft block_size: 2048 model_max_length: 8192 epochs: 2 diff --git a/configs/llm_finetuning/llama3-8b-dpo-qlora.yml b/configs/llm_finetuning/llama3-8b-dpo-qlora.yml index 15e019cdfd..de786fb6bf 100644 --- a/configs/llm_finetuning/llama3-8b-dpo-qlora.yml +++ b/configs/llm_finetuning/llama3-8b-dpo-qlora.yml @@ -1,4 +1,4 @@ -task: llm +task: llm-dpo base_model: meta-llama/Meta-Llama-3-8B-Instruct project_name: autotrain-llama3-8b-dpo-qlora log: tensorboard @@ -15,7 +15,6 @@ data: prompt_text_column: prompt params: - trainer: dpo block_size: 1024 model_max_length: 2048 max_prompt_length: 512 diff --git a/configs/llm_finetuning/llama3-8b-orpo-space.yml b/configs/llm_finetuning/llama3-8b-orpo-space.yml index c732212824..29e07899e4 100644 --- a/configs/llm_finetuning/llama3-8b-orpo-space.yml +++ b/configs/llm_finetuning/llama3-8b-orpo-space.yml @@ -1,4 +1,4 @@ -task: llm +task: llm-orpo base_model: meta-llama/Meta-Llama-3-8B-Instruct project_name: autotrain-llama3-8b-orpo-t1 log: tensorboard @@ -15,7 +15,6 @@ data: prompt_text_column: prompt params: - trainer: orpo block_size: 1024 model_max_length: 8192 max_prompt_length: 512 diff --git a/configs/llm_finetuning/llama3-8b-orpo.yml b/configs/llm_finetuning/llama3-8b-orpo.yml index 80a4b3f438..d5d8a1c434 100644 --- a/configs/llm_finetuning/llama3-8b-orpo.yml +++ b/configs/llm_finetuning/llama3-8b-orpo.yml @@ -1,4 +1,4 @@ -task: llm +task: llm-orpo base_model: meta-llama/Meta-Llama-3-8B-Instruct project_name: autotrain-llama3-8b-orpo log: tensorboard @@ -15,7 +15,6 @@ data: prompt_text_column: prompt params: - trainer: orpo block_size: 1024 model_max_length: 8192 max_prompt_length: 512 diff --git a/src/autotrain/__init__.py b/src/autotrain/__init__.py index 6c57f39982..c537ea4b6a 100644 --- a/src/autotrain/__init__.py +++ b/src/autotrain/__init__.py @@ -41,7 +41,7 @@ warnings.filterwarnings("ignore", category=UserWarning, module="huggingface_hub") logger = Logger().get_logger() -__version__ = "0.7.106" +__version__ = "0.7.108" def is_colab(): diff --git a/src/autotrain/app/params.py b/src/autotrain/app/params.py index 8399455511..338fe36a0a 100644 --- a/src/autotrain/app/params.py +++ b/src/autotrain/app/params.py @@ -283,9 +283,10 @@ def _munge_params_img_obj_det(self): _params["log"] = "tensorboard" if not self.using_hub_dataset: _params["image_column"] = "autotrain_image" - _params["objects_column"] = "autotrain_label" + _params["objects_column"] = "autotrain_objects" _params["valid_split"] = "validation" else: + _params["image_column"] = self.column_mapping.get("image" if not self.api else "image_column", "image") _params["objects_column"] = self.column_mapping.get( "objects" if not self.api else "objects_column", "objects" diff --git a/src/autotrain/parser.py b/src/autotrain/parser.py index 4f7b32ff1c..9007919e4a 100644 --- a/src/autotrain/parser.py +++ b/src/autotrain/parser.py @@ -70,8 +70,11 @@ def __post_init__(self): } self.task_aliases = { "llm": "lm_training", - "llm_training": "lm_training", - "llm_finetuning": "lm_training", + "llm-sft": "lm_training", + "llm-orpo": "lm_training", + "llm-generic": "lm_training", + "llm-dpo": "lm_training", + "llm-reward": "lm_training", "dreambooth": "dreambooth", "image_binary_classification": "image_multi_class_classification", "image-binary-classification": "image_multi_class_classification", @@ -123,6 +126,12 @@ def _parse_config(self): if self.task == "lm_training": params["chat_template"] = self.config["data"]["chat_template"] + if "-" in self.config["task"]: + params["trainer"] = self.config["task"].split("-")[1] + if params["trainer"] == "generic": + params["trainer"] = "default" + if params["trainer"] not in ["sft", "orpo", "dpo", "reward", "default"]: + raise ValueError("Invalid LLM training task") if self.task != "dreambooth": for k, v in self.config["data"]["column_mapping"].items():