Hf’s python / transformers is a hot mess. It conflates so many different ideas into huge monoliths that it’s barely usable for anything other than the small snippets listed for trying out models.
They need to take a machete to all the cross coupling they’ve metastasized.