refactor: rename setup_config_and_logging to setup_config and update references
This commit is contained in:
@@ -1,28 +1,24 @@
|
||||
#!.venv/bin/python3
|
||||
import argparse
|
||||
import logging
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from core.config import setup_config_and_logging
|
||||
from core.config import setup_config
|
||||
from research.model_trainer import ModelTrainer
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Train DRC Names Models")
|
||||
parser.add_argument("--config", type=str, help="Path to configuration file")
|
||||
parser.add_argument(
|
||||
"--env", type=str, default="development",
|
||||
help="Environment name (default: development)"
|
||||
)
|
||||
parser.add_argument("--type", type=str, help="Specific model type to train")
|
||||
parser.add_argument("--name", type=str, help="Model name")
|
||||
|
||||
parser.add_argument("--config", type=str, help="Path to configuration file")
|
||||
parser.add_argument("--env", type=str, default="development", help="Environment name")
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
# Load configuration and setup logging
|
||||
config = setup_config_and_logging(config_path=args.config, env=args.env)
|
||||
|
||||
trainer = ModelTrainer()
|
||||
config = setup_config(config_path=args.config, env=args.env)
|
||||
trainer = ModelTrainer(config)
|
||||
|
||||
# Train specific model
|
||||
trainer.train_single_model(
|
||||
@@ -30,11 +26,11 @@ def main():
|
||||
model_type=args.type,
|
||||
features=["full_name"]
|
||||
)
|
||||
|
||||
return 0
|
||||
|
||||
except Exception as e:
|
||||
print(f"Training failed: {e}")
|
||||
logging.error(f"Training failed: {e}")
|
||||
traceback.print_exc()
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user