GLiNER icon indicating copy to clipboard operation
GLiNER copied to clipboard

Incompability to Python3.13

Open freinold opened this issue 6 months ago • 3 comments

I'm working with the GLiNER library and noticed it lists sentencepiece as a dependency. However, after searching through the codebase, I can't find any place where sentencepiece is actually imported or used.

This is a problem because sentencepiece is basically unmaintained at this point and has multiple open issues with compatibility on recent Python versions and various operating systems (see google/sentencepiece). Specifically, I want to upgrade my project to Python 3.13, but sentencepiece currently doesn't work with this version and is blocking the upgrade.

Question: Is sentencepiece still required for GLiNER to function, or can it be removed from the dependencies? If it’s not strictly needed anymore, it would be better to drop it to avoid downstream breakage and allow users to upgrade Python safely.

Let me know if you need logs or further info.

freinold avatar Jul 13 '25 18:07 freinold

Sentencepiece is not a hard dependency of transformers any more as I just found out, see https://github.com/huggingface/transformers/issues/39091

freinold avatar Jul 13 '25 21:07 freinold

This has become a show stopper for trying to install on later versions of Python, e.g., using poetry, etc.

ceteri avatar Aug 04 '25 17:08 ceteri

sentencepiece is now available for Python 3.13.

But the dependency python-mecab-ko from the extra tokenizers currently doesn't build on 3.13 on my system (Win10/x64)

@Ingvarstep are you generally tackling 3.13 soon as you're currently doing a lot of changes to the project?

freinold avatar Aug 15 '25 12:08 freinold