added model name loader

This commit is contained in:
Brian Bjarke Jensen
2024-07-22 23:47:11 +02:00
parent 7f0cbea937
commit 3560a61277
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
from .get_model_name import get_model_name
+16
View File
@@ -0,0 +1,16 @@
"""Definition of get_model_name function."""
import logging
from pathlib import Path
def get_model_name(
path: Path,
) -> str:
"""Get model name from model_name file."""
assert isinstance(path, Path)
assert path.exists(), f'{path} does not exist'
with open(file=path, encoding='utf-8') as fh:
model_name = fh.read()
logging.debug('finished')
return model_name