# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

from gRPC_impl.mytransformers import HuggingFaceModel_pb2 as mytransformers_dot_HuggingFaceModel__pb2

GRPC_GENERATED_VERSION = '1.71.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in mytransformers/HuggingFaceModel_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class HuggingFaceModelServiceStub(object):
    """/////////////////////////////////////////////////////////////////////////////////
    Service definition
    /////////////////////////////////////////////////////////////////////////////////
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.getAutoModelForCausalML = channel.unary_unary(
                '/mytransformers.HuggingFaceModelService/getAutoModelForCausalML',
                request_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
                response_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
                _registered_method=True)
        self.getAutoModelForSequenceClassification = channel.unary_unary(
                '/mytransformers.HuggingFaceModelService/getAutoModelForSequenceClassification',
                request_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
                response_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
                _registered_method=True)
        self.getBertModelForSequenceClassification = channel.unary_unary(
                '/mytransformers.HuggingFaceModelService/getBertModelForSequenceClassification',
                request_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
                response_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
                _registered_method=True)
        self.getRobertaModelForSequenceClassification = channel.unary_unary(
                '/mytransformers.HuggingFaceModelService/getRobertaModelForSequenceClassification',
                request_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
                response_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
                _registered_method=True)
        self.getT5ForConditionalGeneration = channel.unary_unary(
                '/mytransformers.HuggingFaceModelService/getT5ForConditionalGeneration',
                request_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
                response_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
                _registered_method=True)
        self.getAutoModelForSeq2SeqLM = channel.unary_unary(
                '/mytransformers.HuggingFaceModelService/getAutoModelForSeq2SeqLM',
                request_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
                response_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
                _registered_method=True)
        self.getXLNetForSequenceClassification = channel.unary_unary(
                '/mytransformers.HuggingFaceModelService/getXLNetForSequenceClassification',
                request_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
                response_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
                _registered_method=True)
        self.generate = channel.unary_unary(
                '/mytransformers.HuggingFaceModelService/generate',
                request_serializer=mytransformers_dot_HuggingFaceModel__pb2.generate_request.SerializeToString,
                response_deserializer=mytransformers_dot_HuggingFaceModel__pb2.generate_response.FromString,
                _registered_method=True)


class HuggingFaceModelServiceServicer(object):
    """/////////////////////////////////////////////////////////////////////////////////
    Service definition
    /////////////////////////////////////////////////////////////////////////////////
    """

    def getAutoModelForCausalML(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getAutoModelForSequenceClassification(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getBertModelForSequenceClassification(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getRobertaModelForSequenceClassification(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getT5ForConditionalGeneration(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getAutoModelForSeq2SeqLM(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getXLNetForSequenceClassification(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def generate(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_HuggingFaceModelServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'getAutoModelForCausalML': grpc.unary_unary_rpc_method_handler(
                    servicer.getAutoModelForCausalML,
                    request_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.FromString,
                    response_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.SerializeToString,
            ),
            'getAutoModelForSequenceClassification': grpc.unary_unary_rpc_method_handler(
                    servicer.getAutoModelForSequenceClassification,
                    request_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.FromString,
                    response_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.SerializeToString,
            ),
            'getBertModelForSequenceClassification': grpc.unary_unary_rpc_method_handler(
                    servicer.getBertModelForSequenceClassification,
                    request_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.FromString,
                    response_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.SerializeToString,
            ),
            'getRobertaModelForSequenceClassification': grpc.unary_unary_rpc_method_handler(
                    servicer.getRobertaModelForSequenceClassification,
                    request_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.FromString,
                    response_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.SerializeToString,
            ),
            'getT5ForConditionalGeneration': grpc.unary_unary_rpc_method_handler(
                    servicer.getT5ForConditionalGeneration,
                    request_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.FromString,
                    response_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.SerializeToString,
            ),
            'getAutoModelForSeq2SeqLM': grpc.unary_unary_rpc_method_handler(
                    servicer.getAutoModelForSeq2SeqLM,
                    request_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.FromString,
                    response_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.SerializeToString,
            ),
            'getXLNetForSequenceClassification': grpc.unary_unary_rpc_method_handler(
                    servicer.getXLNetForSequenceClassification,
                    request_deserializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.FromString,
                    response_serializer=mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.SerializeToString,
            ),
            'generate': grpc.unary_unary_rpc_method_handler(
                    servicer.generate,
                    request_deserializer=mytransformers_dot_HuggingFaceModel__pb2.generate_request.FromString,
                    response_serializer=mytransformers_dot_HuggingFaceModel__pb2.generate_response.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'mytransformers.HuggingFaceModelService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('mytransformers.HuggingFaceModelService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class HuggingFaceModelService(object):
    """/////////////////////////////////////////////////////////////////////////////////
    Service definition
    /////////////////////////////////////////////////////////////////////////////////
    """

    @staticmethod
    def getAutoModelForCausalML(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/mytransformers.HuggingFaceModelService/getAutoModelForCausalML',
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getAutoModelForSequenceClassification(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/mytransformers.HuggingFaceModelService/getAutoModelForSequenceClassification',
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getBertModelForSequenceClassification(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/mytransformers.HuggingFaceModelService/getBertModelForSequenceClassification',
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getRobertaModelForSequenceClassification(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/mytransformers.HuggingFaceModelService/getRobertaModelForSequenceClassification',
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getT5ForConditionalGeneration(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/mytransformers.HuggingFaceModelService/getT5ForConditionalGeneration',
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getAutoModelForSeq2SeqLM(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/mytransformers.HuggingFaceModelService/getAutoModelForSeq2SeqLM',
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getXLNetForSequenceClassification(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/mytransformers.HuggingFaceModelService/getXLNetForSequenceClassification',
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_request.SerializeToString,
            mytransformers_dot_HuggingFaceModel__pb2.fromPretrained_response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def generate(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/mytransformers.HuggingFaceModelService/generate',
            mytransformers_dot_HuggingFaceModel__pb2.generate_request.SerializeToString,
            mytransformers_dot_HuggingFaceModel__pb2.generate_response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
