When using recent versions of the transformers library (4.57.1), loading a SpanMarkerModel fails with the following error:
AttributeError: 'SpanMarkerConfig' object has no attribute '_attn_implementation_internal'
Downgrading transformers to version 4.50.0 or older resolves the loading issue. However, model.predict() then fails with a ValueError, even with valid input types:
ValueError: text input must be of type 'str' (single example), 'List[str]' (batch or single pretokenized example) or 'List[List[str]]' (batch of pretokenized examples).
This was tested using: model_loading.ipynb notebook example on Google Colab with Python 3.12.12 (22.10.2025.).
My run: model_loading.ipynb.
Environment:
Suggested Fix:
Update SpanMarkerConfig and SpanMarkerModel to be compatible with the latest transformers API. Consider adding version constraints to dependencies as a temporary solution.