Allow ModelResourcesCalculator to use file_pointer_meta.

PiperOrigin-RevId: 517742722
This commit is contained in:
Jiuqiang Tang 2023-03-19 01:31:07 -07:00 committed by Copybara-Service
parent 2e5ea174fe
commit f06e4224b8
2 changed files with 7 additions and 5 deletions

View File

@ -77,9 +77,11 @@ class ModelResourcesCalculator : public api2::Node {
if (options.has_model_file()) { if (options.has_model_file()) {
RET_CHECK(options.model_file().has_file_content() || RET_CHECK(options.model_file().has_file_content() ||
options.model_file().has_file_descriptor_meta() || options.model_file().has_file_descriptor_meta() ||
options.model_file().has_file_name()) options.model_file().has_file_name() ||
options.model_file().has_file_pointer_meta())
<< "'model_file' must specify at least one of " << "'model_file' must specify at least one of "
"'file_content', 'file_descriptor_meta', or 'file_name'"; "'file_content', 'file_descriptor_meta', 'file_name', or "
"'file_pointer_meta'";
} }
return absl::OkStatus(); return absl::OkStatus();
} }

View File

@ -179,9 +179,9 @@ TEST_F(ModelResourcesCalculatorTest, EmptyExternalFileProto) {
auto status = graph.Initialize(graph_config); auto status = graph.Initialize(graph_config);
ASSERT_FALSE(status.ok()); ASSERT_FALSE(status.ok());
EXPECT_THAT(status.message(), EXPECT_THAT(status.message(),
testing::HasSubstr( testing::HasSubstr("'model_file' must specify at least one of "
"'model_file' must specify at least one of " "'file_content', 'file_descriptor_meta', "
"'file_content', 'file_descriptor_meta', or 'file_name'")); "'file_name', or 'file_pointer_meta'"));
} }
TEST_F(ModelResourcesCalculatorTest, GraphServiceNotAvailable) { TEST_F(ModelResourcesCalculatorTest, GraphServiceNotAvailable) {