-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.py
More file actions
62 lines (58 loc) · 1.69 KB
/
template.py
File metadata and controls
62 lines (58 loc) · 1.69 KB
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
import os
import logging
from pathlib import Path
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
list_of_files = [
".github/workflows/.gitkeep",
"config/__init__.py",
"config/configurations.py",
"helper/__init__.py",
"helper/model_class.py",
"helper/load_llm.py",
"vectorstore/__init__.py",
"vectorstore/load_vector_store.py",
"backend/__init__.py",
"backend/load_database.py",
"api/__init__.py",
"api/v1/__init__.py",
"api/v1/api.py",
"router/__init__.py",
"router/endpoints.py",
"utils/__init__.py",
"utils/load_crud.py",
"prompts/__init__.py",
"prompts/prompt_templates.py",
"logger/__init__.py",
"logger/logging_config.py",
"exception/__init__.py",
"exception/custom_exception.py",
"schemas/__init__.py",
"schemas/request_models.py",
"schemas/response_models.py",
"services/__init__.py",
"services/llm_service.py",
"tests/__init__.py",
"tests/unit/__init__.py",
"tests/integration/__init__.py",
"notebooks/research.ipynb",
"app.py",
"requirements.txt",
"Dockerfile",
".dockerignore",
".gitignore",
".env",
"setup.py",
"README.md"
]
for filepath in list_of_files:
filepath = Path(filepath)
filedir, filename = os.path.split(filepath)
if filedir != "":
os.makedirs(filedir, exist_ok=True)
logging.info(f"Created Directory: {filedir}")
if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0):
with open(filepath, 'w') as file:
pass
logging.info(f"Created File: {filepath}")
else:
logging.info(f"File already exists : {filepath}")