diff --git a/paddlehub/module/module.py b/paddlehub/module/module.py index aed27a1958bf228fe721f30f0f12f32ef08110de..95555f2224dadef3e83e0da73b3fa6bf270b9b71 100644 --- a/paddlehub/module/module.py +++ b/paddlehub/module/module.py @@ -576,7 +576,7 @@ class Module(object): fetch_dict[key] = program.global_block().var(var.name) # update BERT/ERNIE's input tensor's sequence length to max_seq_len - if self.name.startswith("bert") or self.name.startswith("ernie"): + if "bert" in self.name or self.name.startswith("ernie"): MAX_SEQ_LENGTH = 512 if max_seq_len > MAX_SEQ_LENGTH or max_seq_len <= 0: raise ValueError(