generated from felixm/defaultpy
34 lines
718 B
Python
34 lines
718 B
Python
import logging
|
|
import sys
|
|
|
|
from rich.logging import RichHandler
|
|
|
|
from toldg.process import process_csv_files, process_ldg_files
|
|
from toldg.train import train
|
|
from toldg.utils import load_config, remove_if_exists, write_meta
|
|
|
|
|
|
def init_logging():
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(message)s",
|
|
datefmt="[%X]",
|
|
handlers=[RichHandler()],
|
|
)
|
|
|
|
|
|
def main():
|
|
init_logging()
|
|
config = load_config()
|
|
if len(sys.argv) > 2 and sys.argv[2] == "train":
|
|
train(config)
|
|
else:
|
|
remove_if_exists(config.output_file)
|
|
write_meta(config)
|
|
process_ldg_files(config)
|
|
process_csv_files(config)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|