BentoML icon indicating copy to clipboard operation
BentoML copied to clipboard

bug: bentoml.transformers.save_model() is constrained on image-classification?

Open xinghua-qu opened this issue 6 months ago • 1 comments

Describe the bug

from transformers import pipeline
import bentoml

pipe = pipeline(
    "automatic-speech-recognition",
)

bentoml.transformers.save_model(
  "automatic-speech-recognition-whiser-large-v2",
  pipe,
  signatures={
    "__call__": {"batchable": False}  # Enable dynamic batching for model
  }
)
print(pipe)```

Traceback (most recent call last):
  File "xxxx.py", line 19, in <module>
    bentoml.transformers.save_model(
  File "/Users/teddyqu/anaconda3/envs/insane-fast-whisper/lib/python3.10/site-packages/bentoml/_internal/frameworks/transformers.py", line 1074, in save_model
    pipeline_.save_pretrained(bento_model.path, **save_kwargs)
  File "/Users/teddyqu/anaconda3/envs/insane-fast-whisper/lib/python3.10/site-packages/transformers/pipelines/base.py", line 883, in save_pretrained
    if self.image_processor is not None:
AttributeError: 'AutomaticSpeechRecognitionPipeline' object has no attribute 'image_processor'

### To reproduce

_No response_

### Expected behavior

_No response_

### Environment

python: 3.10
bentoml: 1.1.10
transformers: 4.36.1

xinghua-qu avatar Dec 15 '23 04:12 xinghua-qu