File size: 706 Bytes
0c746c9
 
 
 
a6bbf63
 
0c746c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
import logging
from pathlib import Path

# Commonly used variables
HUGGINGFACE_MODEL_PATH = "bespin-global/klue-roberta-small-3i4k-intent-classification"
MODEL_SAVE_PATH = "./models"
LOG_DIR = "logs/running_logs"

# Ensure log directory exists
Path(LOG_DIR).mkdir(parents=True, exist_ok=True)

def setup_logging(log_file_name):
    """Set up logging configuration."""
    log_file = os.path.join(LOG_DIR, log_file_name)
    logging.basicConfig(
        level=logging.INFO,
        format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
        handlers=[
            logging.FileHandler(log_file),
            logging.StreamHandler()
        ]
    )
    return logging.getLogger(__name__)