Allow for a default caption file in the folder. Minor bug fixes.

This commit is contained in:
Jaret Burkett
2024-10-10 07:31:33 -06:00
parent 9452929300
commit ab22674980
4 changed files with 15 additions and 5 deletions

View File

@@ -481,9 +481,9 @@ def get_guided_loss_polarity(
loss = pred_loss + pred_neg_loss
if sd.is_flow_matching:
timestep_weight = sd.noise_scheduler.get_weights_for_timesteps(timesteps).to(loss.device, dtype=loss.dtype).detach()
loss = loss * timestep_weight
# if sd.is_flow_matching:
# timestep_weight = sd.noise_scheduler.get_weights_for_timesteps(timesteps).to(loss.device, dtype=loss.dtype).detach()
# loss = loss * timestep_weight
loss = loss.mean([1, 2, 3])