Spaces:
Sleeping
Sleeping
| import os | |
| from pathlib import Path | |
| import logging | |
| logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') | |
| project_name = "summarylm" | |
| list_of_file = [ | |
| ".github/workflows/.gitkeep", | |
| f"src/{project_name}/__init__.py", | |
| f"src/{project_name}/components/__init__.py", | |
| f"src/{project_name}/components/data_ingestion.py", | |
| f"src/{project_name}/components/data_transformation.py", | |
| f"src/{project_name}/components/data_validation.py", | |
| f"src/{project_name}/components/model_evaluation.py", | |
| f"src/{project_name}/components/model_trainer.py", | |
| f"src/{project_name}/utils/__init__.py", | |
| f"src/{project_name}/utils/common.py", | |
| f"src/{project_name}/logging/__init__.py", | |
| f"src/{project_name}/exception/__init__.py", | |
| f"src/{project_name}/config/__init__.py", | |
| f"src/{project_name}/config/configuration.py", | |
| f"src/{project_name}/config/gcloud_syncer.py", | |
| f"src/{project_name}/pipeline/__init__.py", | |
| f"src/{project_name}/pipeline/data_ingestion.py", | |
| f"src/{project_name}/entity/__init__.py", | |
| f"src/{project_name}/constants/__init__.py", | |
| "config/config.yaml", | |
| "params.yaml", | |
| "app.py", | |
| "main.py", | |
| "Dockerfile", | |
| "requirements.txt", | |
| "setup.py", | |
| "research/experiment.ipynb", | |
| ] | |
| for filepath in list_of_file: | |
| filepath = Path(filepath) | |
| filedir, filename = os.path.split(filepath) | |
| if filedir != "": | |
| os.makedirs(filedir, exist_ok=True) | |
| logging.info(f"Creating directory: {filedir} for the file {filename}") | |
| if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0): | |
| with open(filepath, 'w') as f: | |
| pass | |
| logging.info(f"Creating empty file: {filepath}") | |
| else: | |
| logging.info(f"{filename} is already exists") |