Closed david-waterworth closed 1 year ago
It looks like the pipeline
is back to importing every model (this message comes from trying to access an unrelated model). I'll have a look later this week. You can ignore that warning in the meantime, it's irrelevant.
Should be fixed by the PR linked above.
same issue for me on this basic example:
import argparse
from transformers import pipeline
# Create the parser
parser = argparse.ArgumentParser(description="Perform sentiment analysis")
# Add an argument
parser.add_argument('Text', type=str, help="the text to analyze")
# Parse the argument
args = parser.parse_args()
# Load the classifier
classifier = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english")
# Perform sentiment analysis
res = classifier(args.Text)
# Print the result
print(res)
Reinstalled transformers, using v.4.31.0
The fix is not in v4.31.0, you will need to use a source install.
System Info
transformers
version: 4.30.2Who can help?
No response
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Edit: I know this model isn't trained for the "text-classification" task, I get the same problem with a private model I fine tuned.
Results in the message
But I'm using torch==2.0.1 and memory-efficient-attention states "If you have PyTorch 2.0 installed, you shouldn’t use xFormers!"
The message is confusing - I have torch 2.0 installed and pipeline is for inference. This message doesn't occur if I use
AutoModelForSequenceClassification.from_pretrained
Expected behavior
The documentation or the warning message are inconsistent.