Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sayakpaul committed Jan 29, 2025
1 parent 3feca30 commit 3de90c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
7 changes: 0 additions & 7 deletions finetrainers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,13 +869,6 @@ def validate(self, step: int, final_validation: bool = False) -> None:

if num_validation_samples == 0:
logger.warning("No validation samples found. Skipping validation.")
if accelerator.is_main_process:
save_model_card(
args=self.args,
repo_id=self.state.repo_id,
videos=None,
validation_prompts=None,
)
return

self.transformer.eval()
Expand Down
16 changes: 5 additions & 11 deletions finetrainers/utils/hub_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import os
from typing import List, Union

Expand Down Expand Up @@ -28,20 +29,17 @@ def save_model_card(
}
)

training_type = "Full" if args.training_type == "full-finetune" else "LoRA"
model_description = f"""
# {training_type} Finetune
# LoRA Finetune
<Gallery />
## Model description
This is a {training_type.lower()} finetune of model: `{args.pretrained_model_name_or_path}`.
This is a lora finetune of model: `{args.pretrained_model_name_or_path}`.
The model was trained using [`finetrainers`](https://github.com/a-r-r-o-w/finetrainers).
`id_token` used: {args.id_token} (if it's not `None`, it should be used in the prompts.)
## Download model
[Download LoRA]({repo_id}/tree/main) in the Files & Versions tab.
Expand All @@ -56,7 +54,7 @@ def save_model_card(
For more details, including weighting, merging and fusing LoRAs, check the [documentation](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading_adapters) on loading LoRAs in diffusers.
"""
if wandb.run and wandb.run.url:
if wandb.run.url:
model_description += f"""
Find out the wandb run URL and training configurations [here]({wandb.run.url}).
"""
Expand All @@ -72,13 +70,9 @@ def save_model_card(
"text-to-video",
"diffusers-training",
"diffusers",
"finetrainers",
"lora",
"template:sd-lora",
]
if training_type == "Full":
tags.append("full-finetune")
else:
tags.append("lora")

model_card = populate_model_card(model_card, tags=tags)
model_card.save(os.path.join(args.output_dir, "README.md"))

0 comments on commit 3de90c4

Please sign in to comment.