From 35ae4f00d31eb7e06610365b567924e36550dbc6 Mon Sep 17 00:00:00 2001 From: Zhipeng Han Date: Tue, 20 Aug 2024 16:28:53 -0700 Subject: [PATCH] Update custom_ops.md add domain for SentencePiece Op --- docs/custom_ops.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/custom_ops.md b/docs/custom_ops.md index d53ec5653..abbd63316 100644 --- a/docs/custom_ops.md +++ b/docs/custom_ops.md @@ -449,7 +449,8 @@ node = onnx.helper.make_node( outputs=['indices', 'output'], mapping_file_name='vocabulary.txt', unmapping_value="unknown_word", - model=model + model=model, + domain='ai.onnx.contrib' ) inputs = np.array(["Hello world", "Hello world louder"], dtype=object), @@ -459,8 +460,8 @@ add_bos = np.array([0], dtype=np.bool_), add_eos = np.array([0], dtype=np.bool_), reverse = np.array([0], dtype=np.bool_) -tokens = array([17486, 1017, 17486, 1017, 155, 21869], dtype=int32) -indices = array([0, 2, 6], dtype=int64) +tokens = np.array([17486, 1017, 17486, 1017, 155, 21869], dtype=np.int32) +indices = np.array([0, 2, 6], dtype=np.int64) expect(node, inputs=[inputs, nbest_size, alpha, add_bos, add_eos, reverse], outputs=[tokens, indices], name='sp') @@ -1597,4 +1598,4 @@ def run_add_f(): } out = sess.run(None, ort_inputs)[0] ``` - \ No newline at end of file +