Пример #1
0
 def to_proto(self):
     # input: ModelVersion entity
     # returns mlflow.protos.model_registry_pb2.ModelVersion
     model_version = ProtoModelVersion()
     model_version.name = self.name
     model_version.version = str(self.version)
     model_version.creation_timestamp = self.creation_timestamp
     if self.last_updated_timestamp is not None:
         model_version.last_updated_timestamp = self.last_updated_timestamp
     if self.description is not None:
         model_version.description = self.description
     if self.user_id is not None:
         model_version.user_id = self.user_id
     if self.current_stage is not None:
         model_version.current_stage = self.current_stage
     if self.source is not None:
         model_version.source = str(self.source)
     if self.run_id is not None:
         model_version.run_id = str(self.run_id)
     if self.run_link is not None:
         model_version.run_link = str(self.run_link)
     if self.status is not None:
         model_version.status = ModelVersionStatus.from_string(self.status)
     if self.status_message:
         model_version.status_message = self.status_message
     model_version.tags.extend(
         [ProtoModelVersionTag(key=key, value=value) for key, value in self._tags.items()]
     )
     return model_version
Пример #2
0
 def to_proto(self):
     # returns mlflow.protos.model_registry_pb2.ModelVersion
     model_version = ProtoModelVersion()
     model_version.registered_model.MergeFrom(
         self.registered_model.to_proto())
     model_version.version = self.version
     return model_version
Пример #3
0
 def to_proto(self):
     # input: ModelVersion entity
     # returns mlflow.protos.model_registry_pb2.ModelVersion
     model_version = ProtoModelVersion()
     model_version.name = self.name
     model_version.version = str(self.version)
     model_version.creation_timestamp = self.creation_timestamp
     if self.last_updated_timestamp is not None:
         model_version.last_updated_timestamp = self.last_updated_timestamp
     if self.description is not None:
         model_version.description = self.description
     if self.user_id is not None:
         model_version.user_id = self.user_id
     if self.current_stage is not None:
         model_version.current_stage = self.current_stage
     if self.source is not None:
         model_version.source = str(self.source)
     if self.run_id is not None:
         model_version.run_id = str(self.run_id)
     if self.status is not None:
         model_version.status = ModelVersionStatus.from_string(self.status)
     if self.status_message:
         model_version.status_message = self.status_message
     return model_version