def BuildTransformer(self, request, context): if request.transformer_type[:3] not in ['gpu', 'cpu']: return hetr_pb2.BuildReply(status=False) try: self.transformer = build_transformer(name=request.transformer_type, comm=self.comm) return hetr_pb2.BuildReply(status=True) except: return hetr_pb2.BuildReply(status=False)
def BuildTransformer(self, request, context): logger.debug("server: build_transformer") self.transformer_type = request.transformer_type[:3] if self.transformer_type not in ['gpu', 'cpu']: message = 'unknown transformer type {}'.format(self.transformer_type) return hetr_pb2.BuildTransformerReply(status=False, message=message) try: self.transformer = build_transformer(name=request.transformer_type, comm=self.comm) return hetr_pb2.BuildTransformerReply(status=True) except Exception: return hetr_pb2.BuildTransformerReply(status=False, message=traceback.format_exc())
def BuildTransformer(self, request, context): self.transformer = build_transformer(request.transformer_type) return hetr_pb2.BuildReply(status=True)