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

transformers.generation_utils import GenerationMixin #78

Open
thakursc1 opened this issue Jun 19, 2024 · 3 comments
Open

transformers.generation_utils import GenerationMixin #78

thakursc1 opened this issue Jun 19, 2024 · 3 comments

Comments

@thakursc1
Copy link

thakursc1 commented Jun 19, 2024

Hi i get the following import error when using fast5


File /opt/conda/envs/mem_sum/lib/python3.11/site-packages/fastT5/__init__.py:1
----> 1 from .onnx_models import OnnxT5, export_and_get_onnx_model, get_onnx_model
      2 from .ort_settings import get_onnx_runtime_sessions
      3 from .onnx_exporter import generate_onnx_representation, quantize

File /opt/conda/envs/mem_sum/lib/python3.11/site-packages/fastT5/onnx_models.py:16
      2 from .onnx_exporter import (
      3     generate_onnx_representation,
      4     quantize,
      5     get_model_paths,
      6     saved_models_path,
      7 )
      9 from transformers import (
     10     T5Config,
     11     T5ForConditionalGeneration,
   (...)
     14     T5Tokenizer,
     15 )
---> 16 from transformers.generation_utils import GenerationMixin
     17 from transformers.modeling_outputs import (
     18     BaseModelOutputWithPast,
     19     Seq2SeqLMOutput,
     20     BaseModelOutput,
     21 )
     22 import torch

ModuleNotFoundError: No module named 'transformers.generation_utils''
transformers==4.41.2
fastt5==0.1.4
@Ki6an
Copy link
Owner

Ki6an commented Jun 20, 2024

can you try downgrading the transformers version to 4.6.1

"transformers>4.6.1",

@Neel-132
Copy link

Neel-132 commented Jul 1, 2024

Tried that but it gives the following error If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for tokenizers
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

@SamratAdhikari
Copy link

!pip install --quiet transformers==4.28.1
!pip install --quiet fastt5

I downgraded the transformers version to 4.28.1 and now this particular error is gone.

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

4 participants