Skip to content

Commit

Permalink
fix colab parser
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekkrthakur committed Jun 17, 2024
1 parent 0ba4227 commit 9dafb78
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
27 changes: 27 additions & 0 deletions configs/image_scoring/image_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
task: image_regression
base_model: microsoft/resnet-50
project_name: autotrain-img-quality-resnet50
log: tensorboard
backend: local

data:
path: abhishek/img-quality-full
train_split: train
valid_split: null
column_mapping:
image_column: image
target_column: target

params:
epochs: 10
batch_size: 8
lr: 2e-3
optimizer: adamw_torch
scheduler: cosine
gradient_accumulation: 1
mixed_precision: fp16

hub:
username: ${HF_USERNAME}
token: ${HF_TOKEN}
push_to_hub: true
2 changes: 1 addition & 1 deletion src/autotrain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
warnings.filterwarnings("ignore", category=UserWarning, module="huggingface_hub")

logger = Logger().get_logger()
__version__ = "0.7.121"
__version__ = "0.7.122"


def is_colab():
Expand Down
6 changes: 6 additions & 0 deletions src/autotrain/app/colab.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ def start_training(b):
params_val["trainer"] = task_dropdown.value.split(":")[1]
params_val = {k: v for k, v in params_val.items() if k != "trainer"}

chat_template = params_val.get("chat_template")
if chat_template is not None:
params_val = {k: v for k, v in params_val.items() if k != "chat_template"}

if TASK_MAP[task_dropdown.value] == "dreambooth":
prompt = params_val.get("prompt")
if prompt is None:
Expand Down Expand Up @@ -375,6 +379,8 @@ def start_training(b):
"push_to_hub": push_to_hub,
},
}
if task_dropdown.value.startswith("llm"):
config["data"]["chat_template"] = chat_template
else:
config = {
"task": TASK_MAP[task_dropdown.value],
Expand Down

0 comments on commit 9dafb78

Please sign in to comment.