Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def main():
else:
if args.vocab_file is None or args.nlp_task_type is None or args.tokenizer_type is None:
parser.error("Please provide vocab file/nlp_task_type/tokenizer_type.")
transformers_and_bert(model_path, new_model_path, args.tokenizer_type, args.vocab_file, args.nlp_task_type)
transformers_and_bert(model_path, new_model_path, args.vocab_file, args.tokenizer_type, args.nlp_task_type)


if __name__ == "__main__":
Expand Down
7 changes: 7 additions & 0 deletions test/test_tools_add_pre_post_processing_to_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ def test_qatask_with_tokenizer(self):

self.assertEqual(result[0][0], ref_output[0][0])

def test_transformers_and_bert(self):
input_model = os.path.join(test_data_dir, "../bert_qa_decoder_base.onnx")
output_model = (self.temp4onnx / "bert_qa.updated.onnx").resolve()
vocab_file = os.path.join(test_data_dir, "../bert.vocab")

add_ppp.transformers_and_bert(Path(input_model), Path(output_model), Path(vocab_file), "BertTokenizer", "QuestionAnswering")

# Corner Case
def test_debug_step(self):
import onnx
Expand Down