How can I see the installed version of transformers

How can I see which version of transformers I am using ? and how can I update it to the latest verison in case it is not up to date?

try this command

print(transformers.__version__)

3 Likes

See this page https://huggingface.co/transformers/installation.html

which says you can install from source using

git clone https://github.com/huggingface/transformers.git
cd transformers
pip install -e .

(I haven’t tried that, as I’m using Colab which already has a recent version)

The version thing did not work for me. But I found a workaround.

pip uninstall transformers
pip install transformers

updated the transformers from 3.1 to 3.4

1 Like

Try this-
import transformers
print(transformers.version)

image

1 Like