ONNX Model Zoo

nijaru/jina-code-int8

By nijaru · ↓ 0 · ♥ 0 · Updated 2025-12-13

What's in this repo

This page lists the files in nijaru/jina-code-int8, including model_int8.onnx.

  • 1 ONNX models (.onnx files)
  • 4 files, including 1 .md, 1 .onnx, 1 .json
  • Last updated 2025-12-13

ONNX files

File Size Download
model_int8.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

jina-embeddings-v2-base-code (INT8 Quantized)

INT8 dynamically quantized version of jinaai/jina-embeddings-v2-base-code for efficient CPU inference.

Model Details

Property Value
Base Model jinaai/jina-embeddings-v2-base-code
Quantization INT8 (dynamic)
Size 154 MB (vs 612 MB fp32)
Dimensions 768
Max Tokens 8192
Languages English + 30 programming languages

Usage

import onnxruntime as ort
from huggingface_hub import hf_hub_download
from tokenizers import Tokenizer
import numpy as np

# Load
tokenizer = Tokenizer.from_file(hf_hub_download("nijaru/jina-code-int8", "tokenizer.json"))
tokenizer.enable_padding(pad_id=0, pad_token="[PAD]")
tokenizer.enable_truncation(max_length=512)
session = ort.InferenceSession(hf_hub_download("nijaru/jina-code-int8", "model_int8.onnx"))

def embed(texts):
    encoded = tokenizer.encode_batch(texts)
    input_ids = np.array([e.ids for e in encoded], dtype=np.int64)
    attention_mask = np.array([e.attention_mask for e in encoded], dtype=np.int64)
    outputs = session.run(None, {"input_ids": input_ids, "attention_mask": attention_mask})
    embeddings = outputs[0]
    mask = attention_mask[:, :, np.newaxis]
    return (embeddings * mask).sum(axis=1) / mask.sum(axis=1)

embeddings = embed(["def hello(): pass", "authentication flow"])

License

Apache-2.0 (same as base model)

Attribution

Quantized from jinaai/jina-embeddings-v2-base-code by Jina AI.

Model info

feature-extraction onnxruntime
onnxruntime onnx int8 quantized code-embeddings sentence-transformers feature-extraction base_model:jinaai/jina-embeddings-v2-base-code base_model:quantized:jinaai/jina-embeddings-v2-base-code license:apache-2.0 region:us
↓ 0 ♥ 0

Created: 2025-12-13

Updated: 2025-12-13

View on Hugging Face

Files (4)

.gitattributes
README.md
model_int8.onnx ONNX
tokenizer.json

Related models