transformers¶
Bindings for Hugging Face transformers predictors.
Transformers models return ModelOutput dataclasses instead of tensors. Registering predict_raw for
PreTrainedModel unwraps the logits field, so transformers classifiers plug into the prediction,
representation, and quantification pipeline like any other torch module, including after transformations
such as dropout or ensemble.
Functions¶
Extract the prediction tensor from a transformers model output. |