66import configparser
77import torch
88import toml
9- import src .log .logger as scan_log
109from db .conn import create_table
1110
1211def load_config_from_toml (file_path ):
@@ -18,11 +17,11 @@ def load_config_from_toml(file_path):
1817 config = toml .load (file )
1918 return config
2019 except FileNotFoundError :
21- scan_log . error (f"cannot find { file_path } " )
20+ print (f"cannot find { file_path } " , flush = True )
2221 except toml .TomlDecodeError as e :
23- scan_log . error (f"cannot parse { file_path } as a valid toml file, error: { e } " )
22+ print (f"cannot parse { file_path } as a valid toml file, error: { e } " , flush = True )
2423 except Exception as e :
25- scan_log . error (f"unknown error when loading config file, error: { e } " )
24+ print (f"unknown error when loading config file, error: { e } " , flush = True )
2625 return None
2726
2827def get_model_path ():
@@ -43,12 +42,12 @@ def get_interface_config():
4342LOG_DIR = os .path .join (BILIVE_DIR , 'logs' )
4443VIDEOS_DIR = os .path .join (BILIVE_DIR , 'Videos' )
4544if not os .path .exists (SRC_DIR + '/db/data.db' ):
46- scan_log . info ("Initialize the database" )
45+ print ("Initialize the database" , flush = True )
4746 create_table ()
4847
4948config = load_config_from_toml (os .path .join (BILIVE_DIR , 'settings.toml' ))
5049if config is None :
51- scan_log . error ("failed to load config file, please check twice" )
50+ print ("failed to load config file, please check twice" , flush = True )
5251 exit (1 )
5352
5453GPU_EXIST = torch .cuda .is_available ()
0 commit comments