Skip to content

Commit

Permalink
Improve error message when using the distributed gbt learner with a n…
Browse files Browse the repository at this point in the history
…on supported task.

PiperOrigin-RevId: 673362728
  • Loading branch information
achoum authored and copybara-github committed Sep 11, 2024
1 parent 3e22c90 commit b7f5472
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,12 @@ absl::Status DistributedGradientBoostedTreesWorker::GetLabelStatistics(
answer->mutable_label_statistics(), thread_pool_.get()));
} break;
default:
return absl::InvalidArgumentError("Not supported task");
return absl::InvalidArgumentError(
absl::StrCat("The distributed gradient boosted trees learner does "
"not support this task:",
model::proto::Task_Name(welcome_.train_config().task()),
". Use the non-distributed "
"version of the learner."));
}

return absl::OkStatus();
Expand Down Expand Up @@ -1267,7 +1272,12 @@ absl::StatusOr<LossResults> DistributedGradientBoostedTreesWorker::Loss(
break;
}
default:
return absl::InvalidArgumentError("Not supported task");
return absl::InvalidArgumentError(
absl::StrCat("The distributed gradient boosted trees learner does "
"not support this task:",
model::proto::Task_Name(welcome_.train_config().task()),
". Use the non-distributed "
"version of the learner."));
}
}

Expand Down

0 comments on commit b7f5472

Please sign in to comment.