提交 536cc335 编写于 作者: L luoyang

Fix bugs in c-api text

上级 b3fac0cd
...@@ -37,16 +37,16 @@ LookupOperation::LookupOperation(const std::shared_ptr<Vocab> &vocab, const std: ...@@ -37,16 +37,16 @@ LookupOperation::LookupOperation(const std::shared_ptr<Vocab> &vocab, const std:
bool LookupOperation::ValidateParams() { bool LookupOperation::ValidateParams() {
if (vocab_ == nullptr) { if (vocab_ == nullptr) {
LOG(ERROR) << "Lookup: vocab object type is incorrect or null."; MS_LOG(ERROR) << "Lookup: vocab object type is incorrect or null.";
return false; return false;
} }
if (unknown_token_.empty()) { if (unknown_token_.empty()) {
LOG(ERROR) << "Lookup: no unknown token is specified."; MS_LOG(ERROR) << "Lookup: no unknown token is specified.";
return false; return false;
} else { } else {
default_id_ = vocab_->Lookup(unknown_token_); default_id_ = vocab_->Lookup(unknown_token_);
if (default_id_ == Vocab::kNoTokenExists) { if (default_id_ == Vocab::kNoTokenExists) {
LOG(ERROR) << "Lookup: unknown_token: [" + unknown_token_ + "], does not exist in vocab."; MS_LOG(ERROR) << "Lookup: unknown_token: [" + unknown_token_ + "], does not exist in vocab.";
return false; return false;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册