added model name loader
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
from .get_model_name import get_model_name
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user