added utility script
CI Pipeline / Test (pull_request) Failing after 2m31s
CI Pipeline / Build and Publish (./Dockerfile.model, ${{ vars.docker_repo_url }}/${{ gitea.repository }}/model) (pull_request) Has been skipped
CI Pipeline / Build and Publish (./Dockerfile.web_ui, ${{ vars.docker_repo_url }}/${{ gitea.repository }}/web_ui) (pull_request) Has been skipped

This commit is contained in:
brian
2024-10-19 19:15:41 +00:00
parent 4f22b9755c
commit bf44947024
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -1,2 +1,3 @@
from .get_class import get_class
from .load_model import DEVICE, load_model from .load_model import DEVICE, load_model
from .vcda_dataset import VCDADataset from .vcda_dataset import VCDADataset
+10
View File
@@ -0,0 +1,10 @@
from importlib import import_module
from types import ModuleType
def get_class(path: str) -> ModuleType:
parts = path.split('.')
module_path = '.'.join(parts[:-1])
class_name = parts[-1]
module = import_module(module_path)
return getattr(module, class_name)