
    if not isinstance(train_data, tuple) and not U.is_huggingface_from_data(train_data):
        err = &#34;&#34;&#34;
            Please pass training data in the form of a tuple of numpy.ndarrays
            or data returned from a ktrain texts_from* function.
            &#34;&#34;&#34;
        raise Exception(err)

    if not isinstance(preproc, tpp.TextPreprocessor):
        msg = &#34;The preproc argument is required.&#34;
        msg += &#34; The preproc arg should be an instance of TextPreprocessor