Downloads · 30 days
1
1% of all-time downloads
sinhashubham/gemma-3-270m-it-onnx-fp16
gemma-3-270m-it-onnx-fp16 is a machine learning model from sinhashubham. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a quantized FP16 ONNX version of Google's Gemma-3 270M Instruction-Tuned model, optimized for browser deployment with ONNX Runtime Web.
Downloads · 30 days
1
1% of all-time downloads
All-time downloads
84
Public
Repo size
5.3 GB
Likes
0
Public
Click a slice to open those files.
.onnx3.5 GB · 99%
From the Hugging Face model README
This is a quantized FP16 ONNX version of Google's Gemma-3 270M Instruction-Tuned model, optimized for browser deployment with ONNX Runtime Web.
This model is designed for browser deployment using ONNX Runtime Web with:
import { InferenceSession, Tensor } from 'onnxruntime-web';
// Load the model
const session = await InferenceSession.create('./onnx/model.onnx', {
executionProviders: ['webgpu', 'wasm']
});
// Run inference
const inputIds = new Tensor('int64', [2, 818, 5279, 529, 7001, 563], [1, 6]);
const attentionMask = new Tensor('int64', [1, 1, 1, 1, 1, 1], [1, 6]);
const results = await session.run({
input_ids: inputIds,
attention_mask: attentionMask
});
const logits = results.logits; // Shape: [1, 6, 262144]
import onnxruntime as ort
import numpy as np
# Load the model
session = ort.InferenceSession('onnx/model.onnx')
# Prepare inputs
input_ids = np.array([[2, 818, 5279, 529, 7001, 563]], dtype=np.int64)
attention_mask = np.array([[1, 1, 1, 1, 1, 1]], dtype=np.int64)
# Run inference
outputs = session.run(None, {
'input_ids': input_ids,
'attention_mask': attention_mask
})
logits = outputs[0] # Shape: (1, 6, 262144)
onnx/model.onnx - FP16 ONNX model file (symlink to model_fp32_fp16.onnx)onnx/model_fp32_fp16.onnx - FP16 ONNX model fileonnx/model_fp32.onnx - Original FP32 ONNX model file (for comparison)config.json - Model configurationtokenizer.json - Fast tokenizertokenizer.model - SentencePiece tokenizergeneration_config.json - Generation parametersThis model was converted using:
This model inherits the license from the original Gemma-3 270M model. Please refer to the original model card for license details.
If you use this model, please cite the original work:
@misc{gemma3,
title={Gemma 3: Advancing Open Language Models},
author={Google DeepMind},
year={2024},
url={https://huggingface.co/google/gemma-3-270m-it}
}