add domain for SentencePiece Op
This commit is contained in:
Zhipeng Han 2024-08-21 09:52:54 -07:00 коммит произвёл GitHub
Родитель 711a2cfa69
Коммит 85ffb94169
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -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]
```
</details>
</details>