提交 f671f133 编写于 作者: 文幕地方's avatar 文幕地方

move chunk to infer model

上级 c703a589
...@@ -94,8 +94,11 @@ class VQATokenPad(object): ...@@ -94,8 +94,11 @@ class VQATokenPad(object):
'input_ids', 'labels', 'token_type_ids', 'bbox', 'input_ids', 'labels', 'token_type_ids', 'bbox',
'attention_mask' 'attention_mask'
]: ]:
if self.infer_mode and key == 'labels': if self.infer_mode:
continue if key != 'labels':
length = min(len(data[key]), self.max_seq_len) length = min(len(data[key]), self.max_seq_len)
data[key] = np.array(data[key][:length], dtype='int64') data[key] = data[key][:length]
else:
continue
data[key] = np.array(data[key], dtype='int64')
return data return data
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册