You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
My own task or dataset (give details below)
Reproduction (minimal, reproducible, runnable)
from optimum.onnxruntime import ORTModelForFeatureExtraction
from transformers import AutoTokenizer
model_checkpoint = "moka-ai/m3e-base"
save_directory = "test"
# Load a model from transformers and export it to ONNX
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
import pdb;pdb.set_trace()
ort_model = ORTModelForFeatureExtraction.from_pretrained(model_checkpoint, export=True, from_transformers=True)
# Save the ONNX model and tokenizer
ort_model.save_pretrained(save_directory)
tokenizer.save_pretrained(save_directory)
System Info
Who can help?
@michaelbenayoun
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction (minimal, reproducible, runnable)
onnx output
{'name': 'last_hidden_state',
'shape': ['batch_size', 'sequence_length', 768],
'type': 'tensor(float)'}
Expected behavior
onnx output
{'name': 'last_hidden_state',
'shape': ['batch_size', 1, 768],
'type': 'tensor(float)'}
The text was updated successfully, but these errors were encountered: