test: add unit test to ensure all config types are instantiable (#1601)

This commit is contained in:
Ashwin Bharambe 2025-03-12 22:29:58 -07:00 committed by GitHub
parent 0a0d6cb96e
commit d072b5fa0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
71 changed files with 662 additions and 465 deletions

View file

@ -4,7 +4,7 @@
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
from typing import Literal, Optional
from typing import Any, Dict, Literal, Optional
from pydantic import BaseModel
@ -12,3 +12,9 @@ from pydantic import BaseModel
class TorchtunePostTrainingConfig(BaseModel):
torch_seed: Optional[int] = None
checkpoint_format: Optional[Literal["meta", "huggingface"]] = "meta"
@classmethod
def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> Dict[str, Any]:
return {
"checkpoint_format": "meta",
}