Skip to content

Commit 0064a1a

Browse files
author
Sayan Shaw
committed
update spm decoder test
1 parent 5a63dfd commit 0064a1a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

onnxruntime_extensions/_cuops.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ def get_inputs(cls):
367367
cls.io_def("ids", onnx.TensorProto.INT64, [None]),
368368
cls.io_def('fairseq', onnx_proto.TensorProto.BOOL, [None])
369369
]
370+
371+
@classmethod
372+
def input_default_values(cls):
373+
return {
374+
'fairseq': [False]
375+
}
370376

371377
@classmethod
372378
def get_outputs(cls):

test/test_sentencepiece_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ def test_spm_decoder(self):
567567
fullname = util.get_test_data_file('data', 'en.wiki.bpe.vs100000.model')
568568
ofunc = OrtPyFunction.from_customop('SentencepieceDecoder', model=open(fullname, 'rb').read())
569569

570-
result = ofunc(np.array([1095, 4054, 26, 2022, 755, 99935], dtype=np.int64))
570+
result = ofunc(np.array([1095, 4054, 26, 2022, 755, 99935], dtype=np.int64), np.array([False], dtype=np.bool_))
571571
self.assertEqual(' '.join(result), 'best hotel in bay area.')
572572

573573

0 commit comments

Comments
 (0)