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

template.py 2.4 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  1. import os
  2. from pathlib import Path
  3. import logging
  4. logging.basicConfig(level=logging.INFO, format='[%(asctime)s]: %(message)s:')
  5. project_name = "toxic"
  6. list_of_files = [
  7. ".github/workflows/.gitkeep",
  8. f'src/{project_name}/__init__.py',
  9. f'src/{project_name}/components/__init__.py',
  10. f'src/{project_name}/components/data_ingestion.py',
  11. f'src/{project_name}/components/data_transformation.py',
  12. f'src/{project_name}/components/data_validation.py',
  13. f'src/{project_name}/components/model_trainer.py',
  14. f'src/{project_name}/components/model_evaluation.py',
  15. f'src/{project_name}/components/model_pusher.py',
  16. f'src/{project_name}/configuration/__init__.py',
  17. f'src/{project_name}/configuration/configuration.py',
  18. f'src/{project_name}/constants/__init__.py',
  19. f'src/{project_name}/entity/__init__.py',
  20. f'src/{project_name}/entity/config_entity.py',
  21. f'src/{project_name}/entity/artifact_entity.py',
  22. f'src/{project_name}/exception/__init__.py',
  23. f'src/{project_name}/logger/__init__.py',
  24. f'src/{project_name}/pipeline/__init__.py',
  25. f'src/{project_name}/pipeline/train_pipeline.py',
  26. f'src/{project_name}/pipeline/prediction_pipeline.py',
  27. f'src/{project_name}/pipeline/stage_01_data_ingestion.py',
  28. f'src/{project_name}/pipeline/stage_02_prepare_base_model.py',
  29. f'src/{project_name}/pipeline/stage_03_model_trainer.py',
  30. f'src/{project_name}/pipeline/stage_04_model_evaluation.py',
  31. f'src/{project_name}/ml/__init__.py',
  32. f'src/{project_name}/ml/model.py',
  33. f'src/{project_name}/utils/__init__.py',
  34. f'src/{project_name}/utils/common.py',
  35. "config/config.yaml",
  36. "dvc.yaml",
  37. "params.yaml",
  38. 'app.py',
  39. 'requirements.txt',
  40. 'Dockerfile',
  41. 'setup.py',
  42. "research/experimental_work_.ipynb",
  43. "templates/index.html",
  44. '.dockerignore'
  45. ]
  46. for filepath in list_of_files:
  47. filepath = Path(filepath)
  48. filedir, filename = os.path.split(filepath)
  49. if filedir != '':
  50. os.makedirs(filedir, exist_ok=True)
  51. logging.info(f"Creating directory; {filedir} for the file: {filename}")
  52. if (not os.path.exists(filepath)) or (os.path.getsize(filepath)==0):
  53. with open(filepath, 'w') as f:
  54. pass
  55. logging.info(f"Creating empty file: {filepath}")
  56. else:
  57. logging.info(f"{filename} is already exists")
Tip!

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

Comments

Loading...