Ki6an / fastT5

⚡ boost inference speed of T5 models by 5x & reduce the model size by 3x.
Apache License 2.0
564 stars 72 forks source link

transformers.generation_utils import GenerationMixin #78

Open thakursc1 opened 3 months ago

thakursc1 commented 3 months ago

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 commented 3 months ago

can you try downgrading the transformers version to 4.6.1 https://github.com/Ki6an/fastT5/blob/20441b33394e71f7612f39f228ecbe1925cd10ae/setup.py#L45

Neel-132 commented 3 months ago

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