Skip to content

Commit

Permalink
Merge pull request #16 from idiap/revert
Browse files Browse the repository at this point in the history
Revert consistency checks for optimizer parameters
  • Loading branch information
eginhard authored Jan 7, 2025
2 parents 33fd5a9 + c77a3ae commit 267a45c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 42 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ build-backend = "hatchling.build"

[project]
name = "coqui-tts-trainer"
version = "0.2.1"
version = "0.2.2"
description = "General purpose model trainer for PyTorch that is more flexible than it should be, by 🐸Coqui."
readme = "README.md"
requires-python = ">=3.10, <3.13"
Expand Down
30 changes: 0 additions & 30 deletions tests/test_config.py

This file was deleted.

12 changes: 1 addition & 11 deletions trainer/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dataclasses import asdict, dataclass, field
from dataclasses import dataclass, field
from typing import Any

from coqpit import Coqpit
Expand Down Expand Up @@ -227,13 +227,3 @@ class TrainerConfig(Coqpit):
default=54321,
metadata={"help": "Global seed for torch, random and numpy random number generator. Defaults to 54321"},
)

def check_values(self) -> None:
"""Check config fields."""
c = asdict(self)
optimizer_fields = ["optimizer", "grad_clip", "lr", "optimizer_params", "lr_scheduler"]
is_list = [isinstance(c[field], list) for field in optimizer_fields]
consistent = all(is_list) or not any(is_list)
if not consistent:
msg = f"Either none or all of these fields must be a list: {optimizer_fields}"
raise TypeError(msg)

0 comments on commit 267a45c

Please sign in to comment.