Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 646431002
  • Loading branch information
tf-text-github-robot committed Jun 25, 2024
1 parent dd91905 commit 767dfc8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions tensorflow_text/core/kernels/sentencepiece_kernels.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct SentencepieceResource : public ResourceBase {
.WithName(unique_node_name)
.WithAttr("model", model)
.WithAttr("use_node_name_sharing", true));
return OkStatus();
return absl::OkStatus();
}
};

Expand Down Expand Up @@ -133,13 +133,13 @@ tensorflow::Status HandleExtraOptions(OpKernelContext* ctx,
// the reader lock once and do a quick check first.
absl::ReaderMutexLock l(&sp->mu);
if (sp->SameOptions(add_bos, add_eos, reverse)) {
return OkStatus();
return absl::OkStatus();
}
}

absl::WriterMutexLock lock(&sp->mu);
if (sp->SameOptions(add_bos, add_eos, reverse)) {
return OkStatus();
return absl::OkStatus();
}
string options;
sp->add_bos = add_bos;
Expand All @@ -164,7 +164,7 @@ tensorflow::Status HandleExtraOptions(OpKernelContext* ctx,
TF_RETURN_IF_ERROR(ToTFStatus(sp->processor.SetEncodeExtraOptions(options)));
TF_RETURN_IF_ERROR(ToTFStatus(sp->processor.SetDecodeExtraOptions(options)));

return OkStatus();
return absl::OkStatus();
}

} // namespace
Expand Down Expand Up @@ -227,7 +227,7 @@ class SentencepieceOp : public OpKernel {
}

*resource = sp;
return OkStatus();
return absl::OkStatus();
};

// Register the ResourceType alias.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Status TokenizeByLabel(const absl::string_view& text,
last_character_is_break_character = is_break_character;
}

return OkStatus();
return absl::OkStatus();
}

} // namespace
Expand Down
6 changes: 3 additions & 3 deletions tensorflow_text/core/kernels/tokenizer_from_logits_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ Status TokenizeByLogits(const absl::string_view& text,
std::vector<absl::string_view> chars;
if (!GetUTF8Chars(text, &chars)) {
return Status(
static_cast<tsl::errors::Code>(absl::StatusCode::kInvalidArgument),
static_cast<absl::StatusCode>(absl::StatusCode::kInvalidArgument),
absl::StrCat("Input string is not utf8 valid: ", text));
}

if (chars.size() > logits.dimension(1)) {
return Status(
static_cast<tsl::errors::Code>(absl::StatusCode::kInvalidArgument),
static_cast<absl::StatusCode>(absl::StatusCode::kInvalidArgument),
absl::StrCat("Number of logits, ", logits.dimension(1),
", is insufficient for text \"", text, "\""));
}
Expand Down Expand Up @@ -116,7 +116,7 @@ Status TokenizeByLogits(const absl::string_view& text,
last_character_is_break_character = is_break_character;
}

return OkStatus();
return absl::OkStatus();
}

} // namespace
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_text/core/kernels/wordpiece_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Status GetTableHandle(const string& input_name, OpKernelContext* ctx,
*container = h(0);
*table_handle = h(1);
}
return OkStatus();
return absl::OkStatus();
}

// Gets the LookupTable stored in the ctx->resource_manager() with key
Expand Down Expand Up @@ -137,7 +137,7 @@ class LookupTableVocab : public WordpieceVocab {

Status ToStatus(const LookupStatus& status) {
if (status.success) {
return OkStatus();
return absl::OkStatus();
}

return errors::InvalidArgument(status.error_msg);
Expand Down

0 comments on commit 767dfc8

Please sign in to comment.