mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-07 08:26:06 +00:00
[dev] modify base model registry module
This commit is contained in:
parent
02bb9718be
commit
6b3fb6bbc9
2 changed files with 3 additions and 3 deletions
|
|
@ -33,7 +33,7 @@ class BaseModel(metaclass=ABCMeta):
|
|||
self.data = {}
|
||||
self.logger = Logger.get_logger()
|
||||
|
||||
obj_cls = MODEL_REGISTRY.get(self.method_type)
|
||||
obj_cls = MODEL_REGISTRY[self.method_type]
|
||||
if not obj_cls:
|
||||
raise RuntimeError(f"method_type={self.method_type} is not supported!")
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,6 @@ class Registry(object):
|
|||
raise NotImplementedError
|
||||
self.module_dict.update(module_name_dict)
|
||||
|
||||
def get(self, module_name: str):
|
||||
assert module_name in self.module_dict, f'{module_name} not found in {self.name}'
|
||||
def __getitem__(self, module_name: str):
|
||||
assert module_name in self.module_dict, f"{module_name} not found in {self.name}"
|
||||
return self.module_dict[module_name]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue