-
Notifications
You must be signed in to change notification settings - Fork 339
/
app.py
33 lines (23 loc) · 942 Bytes
/
app.py
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
import fire
from loguru import logger
from utils import project_manager
from utils import cache_data
from utils import train
class App:
def __init__(self):
logger.info("\nHello baby~")
def create(self, project_name: str, single: bool = False):
logger.info("\nCreate Project ----> {}".format(project_name))
pm = project_manager.ProjectManager()
pm.create_project(project_name, single)
def cache(self, project_name: str, base_path: str, search_type: str = "name"):
logger.info("\nCaching Data ----> {}\nPath ----> {}".format(project_name, base_path))
cache = cache_data.CacheData(project_name)
cache.cache(base_path, search_type)
pass
def train(self, project_name: str):
logger.info("\nStart Train ----> {}\n".format(project_name))
trainer = train.Train(project_name)
trainer.start()
if __name__ == '__main__':
fire.Fire(App)