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

stage_00_template.py 1.1 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
36
37
38
39
40
  1. import argparse
  2. import os
  3. import shutil
  4. from tqdm import tqdm
  5. import logging
  6. from src.utils.common import read_yaml, create_directories
  7. import random
  8. STAGE = "STAGE_NAME" ## <<< change stage name
  9. logging.basicConfig(
  10. filename=os.path.join("logs", 'running_logs.log'),
  11. level=logging.INFO,
  12. format="[%(asctime)s: %(levelname)s: %(module)s]: %(message)s",
  13. filemode="a"
  14. )
  15. def main(config_path, params_path):
  16. ## read config files
  17. config = read_yaml(config_path)
  18. params = read_yaml(params_path)
  19. pass
  20. if __name__ == '__main__':
  21. args = argparse.ArgumentParser()
  22. args.add_argument("--config", "-c", default="configs/config.yaml")
  23. args.add_argument("--params", "-p", default="params.yaml")
  24. parsed_args = args.parse_args()
  25. try:
  26. logging.info("\n********************")
  27. logging.info(f">>>>> stage {STAGE} started <<<<<")
  28. main(config_path=parsed_args.config, params_path=parsed_args.params)
  29. logging.info(f">>>>> stage {STAGE} completed!<<<<<\n")
  30. except Exception as e:
  31. logging.exception(e)
  32. raise e
Tip!

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

Comments

Loading...