Skip to content

Commit

Permalink
fix shorttext encoder is_trainable
Browse files Browse the repository at this point in the history
  • Loading branch information
paxcema committed Jun 13, 2023
1 parent 9636253 commit ac3ee69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lightwood/api/json_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ def lookup_encoder(
if encoder_dict["module"] == "PretrainedLangEncoder" and not is_target:
encoder_dict["args"]["output_type"] = "$dtype_dict[$target]"

enc_cls = eval(encoder_dict["module"])
if enc_cls.is_trainable_encoder and hasattr(enc_cls, 'stop_after'):
if eval(encoder_dict["module"]).is_trainable_encoder:
encoder_dict["args"]["stop_after"] = "$problem_definition.seconds_per_encoder"

if is_target_predicting_encoder:
Expand Down
2 changes: 2 additions & 0 deletions lightwood/encoder/text/short.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@


class ShortTextEncoder(BaseEncoder):
is_trainable_encoder = False

def __init__(self, is_target=False, mode=None, device=''):
"""
:param is_target:
Expand Down

0 comments on commit ac3ee69

Please sign in to comment.