Exemplo n.º 1
0
 def deleteModelVersion(self, request, context):
     model_meta_param = ModelVersion.from_proto(request)
     self.model_repo_store.delete_model_version(model_meta_param)
     self.notification_client.send_event(BaseEvent(model_meta_param.model_name,
                                                   json.dumps(model_meta_param.__dict__),
                                                   ModelVersionEventType.MODEL_DELETED))
     return _wrap_response(request.model_meta)
Exemplo n.º 2
0
 def createModelVersion(self, request, context):
     model_meta_param = ModelVersion.from_proto(request)
     model_version_param = ModelVersionParam.from_proto(request)
     model_version_meta = self.model_repo_store.create_model_version(model_meta_param.model_name,
                                                                     model_version_param.model_path,
                                                                     model_version_param.model_type,
                                                                     model_version_param.version_desc,
                                                                     model_version_param.current_stage)
     event_type = MODEL_VERSION_TO_EVENT_TYPE.get(ModelVersionStage.from_string(model_version_param.current_stage))
     if self.notification_client is not None:
         self.notification_client.send_event(BaseEvent(model_version_meta.model_name,
                                                       json.dumps(model_version_meta.__dict__),
                                                       event_type))
     return _wrap_response(model_version_meta.to_meta_proto())
Exemplo n.º 3
0
 def getRegisteredModelDetail(self, request, context):
     model_meta_param = ModelVersion.from_proto(request)
     registered_model_detail = self.model_repo_store.get_registered_model_detail(
         RegisteredModel(model_name=model_meta_param.model_name))
     return _wrap_response(None if registered_model_detail is None else registered_model_detail.to_detail_proto())
Exemplo n.º 4
0
 def getModelVersionDetail(self, request, context):
     model_meta_param = ModelVersion.from_proto(request)
     model_version_meta = self.model_repo_store.get_model_version_detail(model_meta_param)
     return _wrap_response(None if model_version_meta is None else model_version_meta.to_meta_proto())