Spaces:
Sleeping
Sleeping
File size: 1,568 Bytes
c2af030 | 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 | import os
from pathlib import Path
project_name = "codeInsight"
list_of_files = [
f"{project_name}/models/__init__.py",
f"{project_name}/models/model_loader.py",
f"{project_name}/models/peft_trainer.py",
f"{project_name}/training/__init__.py",
f"{project_name}/training/train.py",
f"{project_name}/evaluation/__init__.py",
f"{project_name}/evaluation/evaluator.py",
f"{project_name}/inference/__init__.py",
f"{project_name}/inference/code_assistant.py",
f"{project_name}/data/__init__.py",
f"{project_name}/data/dataset_builder.py",
f"{project_name}/utils/__init__.py",
f"{project_name}/utils/config.py",
f"{project_name}/safety/__init__.py",
f"{project_name}/safety/safety_checker.py",
f"{project_name}/exception/__init__.py",
f"{project_name}/logger/__init__.py",
f"{project_name}/pipeline/__init__.py",
f"{project_name}/pipeline/training_pipeline.py",
f"{project_name}/pipeline/prediction_pipeline.py",
"app.py",
"Demo.py",
"requirements.txt",
"Dockerfile",
"setup.py",
".gitignore",
"README.md",
"config/model.yaml",
]
for filepath in list_of_files:
filepath = Path(filepath)
filedir, filename = os.path.split(filepath)
if filedir != "":
os.makedirs(filedir, exist_ok=True)
if not filepath.exists() or filepath.stat().st_size == 0:
filepath.touch()
else:
print(f'{filename} is already present in {filedir} and has some content. Skipping creation.') |