mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-08 12:30:42 +00:00
[workflow] fixed oom tests (#5275)
* [workflow] fixed oom tests * polish * polish * polish
This commit is contained in:
@@ -61,7 +61,9 @@ class ModelZooRegistry(dict):
|
||||
"""
|
||||
self[name] = (model_fn, data_gen_fn, output_transform_fn, loss_fn, model_attribute)
|
||||
|
||||
def get_sub_registry(self, keyword: Union[str, List[str]], exclude: Union[str, List[str]] = None):
|
||||
def get_sub_registry(
|
||||
self, keyword: Union[str, List[str]], exclude: Union[str, List[str]] = None, allow_empty: bool = False
|
||||
):
|
||||
"""
|
||||
Get a sub registry with models that contain the keyword.
|
||||
|
||||
@@ -95,7 +97,8 @@ class ModelZooRegistry(dict):
|
||||
if not should_exclude:
|
||||
new_dict[k] = v
|
||||
|
||||
assert len(new_dict) > 0, f"No model found with keyword {keyword}"
|
||||
if not allow_empty:
|
||||
assert len(new_dict) > 0, f"No model found with keyword {keyword}"
|
||||
return new_dict
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user