forked from mosaicml/diffusion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
26 lines (18 loc) · 625 Bytes
/
run.py
File metadata and controls
26 lines (18 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright 2022 MosaicML Diffusion authors
# SPDX-License-Identifier: Apache-2.0
"""Run training."""
import textwrap
import hydra
from omegaconf import DictConfig
from diffusion.train import train
@hydra.main(version_base=None)
def main(config: DictConfig) -> None:
"""Hydra wrapper for train."""
if not config:
raise ValueError(
textwrap.dedent("""\
Config path and name not specified!
Please specify these by using --config-path and --config-name, respectively."""))
return train(config)
if __name__ == '__main__':
main()