diff --git a/onnxruntime/contrib_ops/cpu/tokenizer.cc b/onnxruntime/contrib_ops/cpu/tokenizer.cc index e444c9e36f..c991f045f7 100644 --- a/onnxruntime/contrib_ops/cpu/tokenizer.cc +++ b/onnxruntime/contrib_ops/cpu/tokenizer.cc @@ -128,8 +128,10 @@ Status Tokenizer::CharTokenize(OpKernelContext* ctx, size_t N, size_t C, size_t tokens = 0; // length in utf8 chars if (!utf8_validate(reinterpret_cast(s.data()), s.size(), tokens)) { + // Please do not include the input text in the error message as it could + // be deemed as a compliance violation by teams using this operator return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT, - "Input string contains invalid utf8 chars: " + s); + "Input string contains invalid utf8 chars"); } max_tokens = std::max(max_tokens, tokens); ++curr_input; diff --git a/onnxruntime/core/providers/cpu/nn/string_normalizer.cc b/onnxruntime/core/providers/cpu/nn/string_normalizer.cc index 7258ac771d..4e768077ca 100644 --- a/onnxruntime/core/providers/cpu/nn/string_normalizer.cc +++ b/onnxruntime/core/providers/cpu/nn/string_normalizer.cc @@ -224,8 +224,10 @@ Status CopyCaseAction(ForwardIter first, ForwardIter end, OpKernelContext* ctx, if (caseaction == StringNormalizer::LOWER || caseaction == StringNormalizer::UPPER) { std::wstring wstr = converter.from_bytes(s); if (wstr == wconv_error) { + // Please do not include the input text in the error message as it could + // be deemed as a compliance violation by teams using this operator return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT, - "Input contains invalid utf8 chars at: " + static_cast(s)); + "Input contains invalid utf8 chars"); } // In place transform loc.ChangeCase(caseaction, wstr); @@ -357,8 +359,10 @@ Status StringNormalizer::Compute(OpKernelContext* ctx) const { const std::string& s = *first; std::wstring wstr = converter.from_bytes(s); if (wstr == wconv_error) { + // Please do not include the input text in the error message as it could + // be deemed as a compliance violation by teams using this operator return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT, - "Input contains invalid utf8 chars at: " + s); + "Input contains invalid utf8 chars"); } locale.ChangeCase(compare_caseaction_, wstr); if (0 == wstopwords_.count(wstr)) {