BentoML
BentoML copied to clipboard
bug: bentoml.transformers.save_model() is constrained on image-classification?
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
This is an issue with the later versions of transformers.
Install the version transformers==4.32.1
instead and it should work