Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Xformers is not installed correctly." error #25604

Closed
1 of 4 tasks
engageintellect opened this issue Aug 18, 2023 · 1 comment
Closed
1 of 4 tasks

"Xformers is not installed correctly." error #25604

engageintellect opened this issue Aug 18, 2023 · 1 comment

Comments

@engageintellect
Copy link

System Info

System info:

  • Transformers 4.31.0
  • Python 3.11.3

Error:

Xformers is not installed correctly. If you want to use memory_efficient_attention to accelerate training use the following command to install Xformers
pip install xformers.

Code:

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)

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

Steps to reproduce this behavior:

  1. run my code
  2. receive error

Expected behavior

no error

@sgugger
Copy link
Collaborator

sgugger commented Aug 18, 2023

This is a duplicate of #24903

@sgugger sgugger closed this as completed Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants