Spaces:
Sleeping
Sleeping
| 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__) |