From fd2516b299bbe7830c09916347f283b5f7447b5b Mon Sep 17 00:00:00 2001 From: igeni Date: Mon, 25 Mar 2024 04:37:29 +0300 Subject: [PATCH] Changed regular expression to add support of the unicode characters processing and make code simple (#1411) Signed-off-by: igeni Co-authored-by: intellinjun <105184542+intellinjun@users.noreply.github.com> --- .../deployment/squad/MLperf_example/datasets/tokenization.py | 2 +- .../deployment/squad/MLperf_example/tokenization.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/huggingface/pytorch/question-answering/deployment/squad/MLperf_example/datasets/tokenization.py b/examples/huggingface/pytorch/question-answering/deployment/squad/MLperf_example/datasets/tokenization.py index f8cfdd0e0ad..40eff1cab5e 100644 --- a/examples/huggingface/pytorch/question-answering/deployment/squad/MLperf_example/datasets/tokenization.py +++ b/examples/huggingface/pytorch/question-answering/deployment/squad/MLperf_example/datasets/tokenization.py @@ -48,7 +48,7 @@ def validate_case_matches_checkpoint(do_lower_case, init_checkpoint): if not init_checkpoint: return - m = re.match("^.*?([A-Za-z0-9_-]+)/bert_model.ckpt", init_checkpoint) + m = re.match("^.*?([-\w]+)/bert_model.ckpt", init_checkpoint) if m is None: return diff --git a/examples/huggingface/pytorch/question-answering/deployment/squad/MLperf_example/tokenization.py b/examples/huggingface/pytorch/question-answering/deployment/squad/MLperf_example/tokenization.py index 3c45a62ecd2..9f475252674 100644 --- a/examples/huggingface/pytorch/question-answering/deployment/squad/MLperf_example/tokenization.py +++ b/examples/huggingface/pytorch/question-answering/deployment/squad/MLperf_example/tokenization.py @@ -48,7 +48,7 @@ def validate_case_matches_checkpoint(do_lower_case, init_checkpoint): if not init_checkpoint: return - m = re.match("^.*?([A-Za-z0-9_-]+)/bert_model.ckpt", init_checkpoint) + m = re.match("^.*?([-\w]+)/bert_model.ckpt", init_checkpoint) if m is None: return