Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

run.py 1.0 KB

You have to be logged in to leave a comment. Sign In
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
35
  1. import dotenv
  2. import hydra
  3. from omegaconf import DictConfig
  4. # load environment variables from `.env` file if it exists
  5. # recursively searches for `.env` in all folders starting from work dir
  6. dotenv.load_dotenv(override=True)
  7. @hydra.main(config_path="configs/", config_name="config.yaml")
  8. def main(config: DictConfig):
  9. # Imports can be nested inside @hydra.main to optimize tab completion
  10. # https://github.com/facebookresearch/hydra/issues/934
  11. from deadtrees.train import train
  12. from deadtrees.utils import utils
  13. # A couple of optional utilities:
  14. # - disabling python warnings
  15. # - forcing debug-friendly configuration
  16. # - verifying experiment name is set when running in experiment mode
  17. # You can safely get rid of this line if you don't want those
  18. utils.extras(config)
  19. # Pretty print config using Rich library
  20. if config.get("print_config"):
  21. utils.print_config(config, resolve=True)
  22. # Train model
  23. return train(config)
  24. if __name__ == "__main__":
  25. main()
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...