Skip to content

Commit

Permalink
CU-8694pey4u: typehints and mypy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tomolopolis committed May 30, 2024
1 parent f836f65 commit bc78a53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions medcat/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def load_model_pack(cls,
model_pack_path = cls.attempt_unpack(zip_path)

# Load the CDB
cdb = cls.load_cdb(model_pack_path)
cdb: CDB = cls.load_cdb(model_pack_path)

# load config
config_path = os.path.join(model_pack_path, "config.json")
Expand All @@ -417,7 +417,7 @@ def load_model_pack(cls,
addl_ner.append(trf)

# Find metacat models in the model_pack
meta_cats = []
meta_cats: List[MetaCAT] = []
if load_meta_models:
meta_cats = [mc[1] for mc in cls.load_meta_cats(model_pack_path)]

Expand Down Expand Up @@ -450,7 +450,7 @@ def load_cdb(cls, model_pack_path: str) -> CDB:
return cdb

@classmethod
def load_meta_cats(cls, model_pack_path: str, meta_cat_config_dict: Optional[Dict] = None) -> List[tuple(str, MetaCAT)]:
def load_meta_cats(cls, model_pack_path: str, meta_cat_config_dict: Optional[Dict] = None) -> List[Tuple[str, MetaCAT]]:
"""
Args:
Expand All @@ -460,7 +460,7 @@ def load_meta_cats(cls, model_pack_path: str, meta_cat_config_dict: Optional[Dic
e.g. meta_cat_config_dict = {'general': {'device': 'cpu'}}.
Defaults to None.
Returns:
List[tuple(str, MetaCAT)]: list of pairs of meta cat model names (i.e. the task name) and the MetaCAT models.
List[Tuple(str, MetaCAT)]: list of pairs of meta cat model names (i.e. the task name) and the MetaCAT models.
"""
meta_paths = [os.path.join(model_pack_path, path)
for path in os.listdir(model_pack_path) if path.startswith('meta_')]
Expand Down

0 comments on commit bc78a53

Please sign in to comment.