Download pt_variety_identifier/src/utils.py from LCA-PORVID/code: direct link, hf CLI and curl.
- Browser
- Download file 745 Bytes
-
https://huggingface.co/LCA-PORVID/code/resolve/main/pt_variety_identifier/src/utils.py
- Command line
-
hf download hf://LCA-PORVID/code/pt_variety_identifier/src/utils.py
-
curl -L -o utils.py https://huggingface.co/LCA-PORVID/code/resolve/main/pt_variety_identifier/src/utils.py
745 Bytes
| import os | |
| import logging | |
| def setup_logger(CURRENT_PATH, CURRENT_TIME): | |
| print( | |
| f"Logging to {os.path.join(CURRENT_PATH, 'out', str(CURRENT_TIME), 'logs', 'log.txt')}") | |
| logging.basicConfig(filename=os.path.join(CURRENT_PATH, "out", str(CURRENT_TIME), "logs", "log.txt"), filemode='w', | |
| format='%(asctime)s - %(levelname)s - %(message)s', | |
| level=logging.INFO) | |
| def create_output_dir(CURRENT_PATH, CURRENT_TIME): | |
| os.mkdir(os.path.join(CURRENT_PATH, | |
| "out", str(CURRENT_TIME))) | |
| os.mkdir(os.path.join(CURRENT_PATH, "out", | |
| str(CURRENT_TIME), "logs")) | |
| os.mkdir(os.path.join(CURRENT_PATH, "out", | |
| str(CURRENT_TIME), "models")) | |