Download src/config.py from MSLAB/PaperGPT: direct link, hf CLI and curl.
- Browser
- Download file 550 Bytes
-
https://huggingface.co/spaces/MSLAB/PaperGPT/resolve/main/src/config.py
- Command line
-
hf download hf://spaces/MSLAB/PaperGPT/src/config.py
-
curl -L -o config.py https://huggingface.co/spaces/MSLAB/PaperGPT/resolve/main/src/config.py
550 Bytes
| import logging | |
| def configure_logging(logging_level: str = "INFO"): | |
| logging_level = logging_level.upper() | |
| numeric_level = getattr(logging, logging_level, None) | |
| if not isinstance(numeric_level, int): | |
| raise Exception(f"Invalid log level: {numeric_level}") | |
| logging.basicConfig( | |
| level=numeric_level, | |
| datefmt="%Y-%m-%d %H:%M:%S", | |
| format= | |
| "[%(asctime)s] [%(process)s] [%(levelname)s] [%(module)s]: #%(funcName)s @%(lineno)d: %(message)s", | |
| ) | |
| logging.info(f"Logging level: {logging_level}") | |