Skip to content

Commit

Permalink
v0.1.9 patch: ModelConfig
Browse files Browse the repository at this point in the history
Supported assigning `extractor_config`, `head_config`, etc. explicitly.
  • Loading branch information
carefree0910 committed Dec 26, 2020
1 parent 08a8932 commit f3df248
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cflearn/api/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,26 @@ def __init__(
def transform_config(self) -> Dict[str, Any]:
return self.meta_config.setdefault("transform", {})

@transform_config.setter
def transform_config(self, value: Dict[str, Any]) -> None:
self.meta_config["transform"] = value

@property
def extractor_config(self) -> Dict[str, Any]:
return self.meta_config.setdefault("extractor", {})

@extractor_config.setter
def extractor_config(self, value: Dict[str, Any]) -> None:
self.meta_config["extractor"] = value

@property
def head_config(self) -> Dict[str, Any]:
return self.meta_config.setdefault("head", {})

@head_config.setter
def head_config(self, value: Dict[str, Any]) -> None:
self.meta_config["head"] = value

def replace(self, **kwargs: Any) -> None:
pipe_config_dict = self.pipe_config._asdict()
pipe_config_dict.update(kwargs)
Expand Down

0 comments on commit f3df248

Please sign in to comment.