def text_classification_post_process(output_data, **kwargs):
    """Post-process data.

    Args:
        output_data (object): Model output to be post-processed.
        **kwargs: Additional arguments.

    Returns:
        object: Post-processed data.

    """
    import torch

    if isinstance(output_data, transformers.modeling_outputs.SequenceClassifierOutput):
        _, preds = torch.max(output_data.logits, dim=1)
    else:
        _, preds = torch.max(output_data, dim=1)

    return preds
Post-process data.

    Args:
        output_data (object): Model output to be post-processed.
        **kwargs: Additional arguments.

    Returns:
        object: Post-processed data.

    
olive/data/component/post_process_data.py