mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-10 17:37:14 +00:00
Remove document text from error message in a couple of ops (#9003)
This commit is contained in:
parent
c3321b1778
commit
c674343d94
2 changed files with 9 additions and 3 deletions
|
|
@ -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<const unsigned char*>(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;
|
||||
|
|
|
|||
|
|
@ -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<const std::string&>(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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue