trankit icon indicating copy to clipboard operation
trankit copied to clipboard

trankit fails on import

Open saveli opened this issue 6 months ago • 1 comments

trankit fails on import:

from trankit import Pipeline

Python 3.12: ValueError: mutable default <class 'trankit.adapter_transformers.adapter_config.InvertibleAdapterConfig'> for field invertible_adapter is not allowed: use default_factory

Python 3.10 as suggested in closed issues from 2023 with above error:

RuntimeError: Failed to import transformers.models.xlm_roberta.modeling_xlm_roberta because of the following error (look up to see its traceback):
module 'torch' has no attribute 'compiler'

what to try next?

saveli avatar Jun 27 '25 13:06 saveli

Hi @saveli, here it worked when I used Python 3.9.13 and:

trankit==1.1.2
numpy==1.26.4
transformers==4.48.3
adapters==1.1.1

henriporto avatar Jul 03 '25 11:07 henriporto