16 #include "tensorflow_serving/model_servers/server_init.h"
20 #include "absl/log/log.h"
21 #include "absl/strings/string_view.h"
22 #include "tensorflow_serving/model_servers/http_rest_api_handler.h"
23 #include "tensorflow_serving/model_servers/platform_config_util.h"
24 #include "tensorflow_serving/model_servers/prediction_service_impl.h"
25 #include "tensorflow_serving/servables/tensorflow/saved_model_bundle_source_adapter.h"
27 namespace tensorflow {
31 Status SetupPlatformConfigMapForTensorFlowImpl(
32 const SessionBundleConfig& session_bundle_config,
33 PlatformConfigMap& platform_config_map) {
35 CreateTensorFlowPlatformConfigMap(session_bundle_config);
36 return absl::OkStatus();
39 Status UpdatePlatformConfigMapForTensorFlowImpl(
40 PlatformConfigMap& platform_config_map) {
41 return absl::OkStatus();
44 std::unique_ptr<HttpRestApiHandlerBase> CreateHttpRestApiHandlerImpl(
45 int timeout_in_ms, ServerCore* core) {
46 return absl::make_unique<HttpRestApiHandler>(timeout_in_ms, core);
49 std::unique_ptr<PredictionService::Service> CreatePredictionServiceImpl(
50 const PredictionServiceOptions& options) {
51 return absl::make_unique<PredictionServiceImpl>(options);
54 void TensorflowServingFunctionRegistration::Register(
55 absl::string_view type,
56 SetupPlatformConfigMapForTensorFlowFnType setup_platform_config_map_func,
57 UpdatePlatformConfigMapForTensorFlowFnType update_platform_config_map_func,
58 CreateHttpRestApiHandlerFnType create_http_rest_api_handler_func,
59 CreatePredictionServiceFnType create_prediction_service_func) {
60 VLOG(1) <<
"Registering serving functions for " << type;
61 registration_type_ = type;
62 setup_platform_config_map_ = setup_platform_config_map_func;
63 update_platform_config_map_ = update_platform_config_map_func;
64 create_http_rest_api_handler_ = create_http_rest_api_handler_func;
65 create_prediction_service_ = create_prediction_service_func;