From 797c02846ce2fc4e15527791305f0bdbb16c6b7d Mon Sep 17 00:00:00 2001 From: wuzewu Date: Wed, 13 May 2020 23:51:23 +0800 Subject: [PATCH] fix version issue --- paddlehub/module/nlp_module.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddlehub/module/nlp_module.py b/paddlehub/module/nlp_module.py index f472619b..7a80a778 100644 --- a/paddlehub/module/nlp_module.py +++ b/paddlehub/module/nlp_module.py @@ -265,7 +265,7 @@ class TransformerModule(NLPBaseModule): **kwargs) self.max_seq_len = max_seq_len - if version_compare(paddle.__version__, '1.8.0'): + if version_compare(paddle.__version__, '1.8'): with tmp_dir() as _dir: input_dict, output_dict, program = self.context( max_seq_len=max_seq_len) @@ -479,7 +479,7 @@ class TransformerModule(NLPBaseModule): return self.params_layer def forward(self, input_ids, position_ids, segment_ids, input_mask): - if version_compare(paddle.__version__, '1.8.0'): + if version_compare(paddle.__version__, '1.8'): pooled_output, sequence_output = self.model_runner( input_ids, position_ids, segment_ids, input_mask) return { @@ -488,5 +488,5 @@ class TransformerModule(NLPBaseModule): } else: raise RuntimeError( - '{} only support dynamic graph mode in paddle >= 1.8.0'.format( + '{} only support dynamic graph mode in paddle >= 1.8'.format( self.name)) -- GitLab