Open Gabriel-Kissin opened 9 months ago
Having the same Problem. Even to save the Model in the Tensorflow Format is kind of difficult, because I just cannot save encoder and decoder seperatly and onnx to tflite adds custom ops that I don't want.
@AnonymUnsichtbar @Gabriel-Kissin To be fair the TFLite support is currently quite minimal, only a few simple architectures are supported ('albert', 'bert', 'camembert', 'convbert', 'deberta', 'deberta_v2', 'distilbert', 'electra', 'flaubert', 'mobilebert', 'mpnet', 'resnet', 'roberta', 'roformer', 'xlm', 'xlm_roberta').
We haven't added support for decoders/encoder-decoder yet.
tflite adds custom ops
I wonder if this is related to the fact that we use subgraphs in ONNX to handle past key values (KV cache) in a single ONNX model. Have you tried to export to TFLite e.g. a decoder_with_past_model.onnx
instead of decoder_model_merged.onnx
?
I'm also interested in being able to export audio-classification whisper to onnx! This would be a huge help!!!
Hi, export of Transformers Whisper to ONNX for audio-classification is merged in https://github.com/huggingface/optimum/pull/1727, for example:
optimum-cli export onnx --model shhossain/whisper-tiny-bn-emo whisper_onnx
For TFLite, there are no short term plans but I am happy to review PRs.
Feature request
export
audio-classification
model based on OpenAI whisper model to other formatsMotivation
After loading OpenAI's whisper:
and fine-tuning it to use for audio classification, I'd like to export the saved
model.safetensors
model to TFLite.Ways I've tried:
1) Directly: Using the command
optimum-cli export tflite --task audio-classification ...
- raises error2) Via ONNX: I've previously had difficulties exporting direct to TFLite but was able to export to ONNX, and was then able to move it to TF and then TFLite. Trying that route this time however (
optimum-cli export onnx --task audio-classification ...
) failed with errorAny chance this can be added - both exporting to TFLite and to ONNX would be useful.
Many thanks!!!
Your contribution
Apologies, cannot contribute