| Model | FP32 | INT8 | Task |
|---|---|---|---|
| embeddinggemma-300m | model.onnx, model.onnx_data | model_quantized.onnx, model_quantized.onnx_data | text embedding |
# onnxruntime-gpu for run it on GPU
pip install onnxruntime sentencepiece numpy
Every model folder has the same layout:
src/helper.py = onnx session builder (provider selection, threads, memory options)src/example.py = full pipeline: sentencepiece tokenization, batching, inference, cosine similarityonnx/ = the model fileRun the commands from the repository root.
python3 embeddinggemma-300m/src/example.py
0.600231 | The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear, is a bear species endemic to China.
0.153004 | hi
0.554038 | パンダはクマ科の哺乳類で、中国の固有種である。
Note:
tokenizer.model directly with the native idstitle: none | text: {text}task: search result | query: {text}[bos] text [eos], padded per batch to the longest sequence.sentence_embedding, 768 dimensions.embeddinggemma-300m/onnx/model_quantized.onnx 554.6 KiBembeddinggemma-300m/onnx/model.onnx 468.7 KiB