Skip to content

Commit

Permalink
don't add dataset tags if empty due to all local data paths (#2162) […
Browse files Browse the repository at this point in the history
…skip ci]
  • Loading branch information
winglian authored Dec 9, 2024
1 parent c78de6f commit 3862267
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/axolotl/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,19 @@ def terminate_handler(_, __, model_weakref):
}
if cfg.datasets is not None:
if cfg.rl is not None or cfg.reward_model:
model_card_kwarg["dataset_name"] = [
dataset_tags = [
d["path"] for d in cfg.datasets if not Path(d["path"]).is_dir()
]
if dataset_tags:
# guard as create_model_card may fail if dataset_tags is empty list
model_card_kwarg["dataset_name"] = dataset_tags
else:
model_card_kwarg["dataset_tags"] = [
dataset_tags = [
d["path"] for d in cfg.datasets if not Path(d["path"]).is_dir()
]
if dataset_tags:
# guard as create_model_card may fail if dataset_tags is empty list
model_card_kwarg["dataset_tags"] = dataset_tags

trainer.create_model_card(**model_card_kwarg)
except (AttributeError, UnicodeDecodeError):
Expand Down

0 comments on commit 3862267

Please sign in to comment.