11.10 Model Summary
A model summary provides a concise overview of the model. To obtain the
summary after exporting the model, call the summary()
function.
The model summary can be retrieved from ONNX pipeline by calling the
summary() function after executing either
export2db() or export2file(). The summary
includes details such as:
- Whether the model was quantized
- Whether external data was used
- The tokenizer type, pre-processors and post-processors applied
- Other relevant metadata
from oml.utils import ONNXPipeline,ONNXPipelineConfig
model_name="sentence-transformers/all-MiniLM-L6-v2"
em = ONNXPipeline(model_name=model_name,settings={"logging_level":"ERROR"})
em.export2db("allminil6v2")
em.summary()
{'description': "Original model sentence-transformers/all-MiniLM-L6-v2 augmented with pre/post processors. Generated by OML4Py ver. 2.1.
Generated model is not quantized. Generated model doesn't use external data. Model tokenizer is <class 'transformers.models.bert.tokenization_bert.BertTokenizer'>.
Model post processors include: mean_pooling,mean_pooling.", 'producer': 'OML4Py 2.1'}
If the model was exported to the database, the summary is also included in the view storing ONNX metadata information:
SQL> select * from DM$VJALLMINIL6V2;
METADATA
--------------------------------------------------------------------------------
{"function":"embedding","embeddingOutput":"embedding","input":{"input":["DATA"]}
,"pooling":"mean","normalization":true,"maxSequenceLength":256,"suitableDistance
Metrics":["COSINE","DOT","EUCLIDEAN"],"languages":["us"],"modelDescription":{"de
scription":"Original model sentence-transformers/all-MiniLM-L6-v2 augmented with
pre/post processors. Generated by OML4Py ver. 2.1. Generated model is not quant
ized. Generated model doesn't use external data. Model tokenizer is <class 'tran
sformers.models.bert.tokenization_bert.BertTokenizer'>. Model post processors in
clude: mean_pooling,mean_pooling.","producer":"OML4Py 2.1"}}
Parent topic: Import Pretrained Models in ONNX Format