File size: 843 Bytes
66003a2 |
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 27 28 29 30 31 32 33 34 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from hydra import initialize, compose
from omegaconf import DictConfig, OmegaConf
from trainer import Trainer
def main():
parser = argparse.ArgumentParser(description="Train model with configurable YAML file")
parser.add_argument(
"--config",
type=str,
default="default",
help="Name of the config file (without .yaml extension, default: default)"
)
args = parser.parse_args()
with initialize(version_base=None, config_path="config"):
cfg = compose(config_name=args.config)
trainer = Trainer(**cfg)
trainer.run()
if __name__ == "__main__":
main()
|