patil-suraj / onnx_transformers

Accelerated NLP pipelines for fast inference on CPU. Built with Transformers and ONNX runtime.
Apache License 2.0
125 stars 27 forks source link

ModuleNotFoundError: No module named 'transformers.configuration_auto' #13

Open subhamkhemka opened 3 years ago

subhamkhemka commented 3 years ago

Hi

I am getting an error when running the example

from onnx_transformers import pipeline

# Initialize a pipeline by passing the task name and 
# set onnx to True (default value is also True)
nlp = pipeline("sentiment-analysis", onnx=True)
nlp("Transformers and onnx runtime is an awesome combo!")
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-6-b6b36e52d5ec> in <module>
----> 1 from onnx_transformers import pipeline
      2 
      3 # Initialize a pipeline by passing the task name and
      4 # set onnx to True (default value is also True)
      5 nlp = pipeline("sentiment-analysis", onnx=True)

/opt/anaconda3/lib/python3.8/site-packages/onnx_transformers/__init__.py in <module>
      2 
      3 # Pipelines
----> 4 from .pipelines import (
      5     CsvPipelineDataFormat,
      6     JsonPipelineDataFormat,

/opt/anaconda3/lib/python3.8/site-packages/onnx_transformers/pipelines.py in <module>
     16 from onnxruntime import GraphOptimizationLevel, InferenceSession, SessionOptions, get_all_providers
     17 from psutil import cpu_count
---> 18 from transformers.configuration_auto import AutoConfig
     19 from transformers.configuration_utils import PretrainedConfig
     20 from transformers.convert_graph_to_onnx import convert_pytorch, convert_tensorflow, infer_shapes

ModuleNotFoundError: No module named 'transformers.configuration_auto'

Kindly help

piegu commented 2 years ago

Hello @subhamkhemka.

I guess you use a recent version of transformers (4.11.3 is the actual version)? Unfortunately, I think onnx_transformers is no longer up to date (see this post of @patil-suraj).

kb-open commented 1 year ago

Is there any plans to fix this? Or do we consider this project to have died?