Transformers suddenly complaining about pytorch?

Hello the team,

Huggingface is suddenly complaining about pytorch … but I have been only using tensorflow all along so far! Do you know what could cause this issue?

from transformers import AutoTokenizer, AutoModelForSequenceClassification
  
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased-finetuned-sst-2-english")

model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased-finetuned-sst-2-english")
ImportError: 
AutoModelForSequenceClassification requires the PyTorch library but it was not found in your environment. Checkout the instructions on the
installation page: https://pytorch.org/get-started/locally/ and follow the ones that match your environment.

Thanks!

If you want to use tensorflow models, try TFAutoModelForSequenceClassification module.

2 Likes

just found it, actually. Thanks!

2 Likes