Downloads · 30 days
0
dreuxx26/HRM-Grammar-Light_ONNX-int8
HRM-Grammar-Light_ONNX-int8 is a machine learning model from dreuxx26. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Lightweight multilingual grammar correction model, exported to ONNX and quantized to int8 for efficient inference.
Downloads · 30 days
0
Access
Public
Updated Aug 12, 2025
Repo size
936 MB
Likes
0
Public
Click a slice to open those files.
.data256 MB · 56%
From the Hugging Face model README
Lightweight multilingual grammar correction model, exported to ONNX and quantized to int8 for efficient inference.
It corrects text in multiple languages. Given a prompt like:
corregir español: el casa es grande
it generates the corrected version:
La casa es grande.
hrm_grammar_light.onnx: standard precision (fp32) ONNX export ACT 4 o ACT 5hrm_grammar_light_int8.onnx: int8 quantized ONNX (smaller, faster)import onnxruntime as ort
import numpy as np
# Load model
session = ort.InferenceSession("hrm_grammar_light_int8.onnx")
# Prepare your input sequence (tokenized, see below)
input_ids = np.array([[...]], dtype=np.int64) # shape (1, seq_len)
attention_mask = np.ones_like(input_ids)
# Run inference
outputs = session.run(["logits"], {
"input_ids": input_ids,
"labels": None,
"attention_mask": attention_mask,
"language_ids": None
})
logits = outputs[0] # (1, seq_len, vocab_size)
This model uses the t5-small vocabulary (Hugging Face Transformers). To tokenize:
from transformers import T5Tokenizer
tokenizer = T5Tokenizer.from_pretrained("t5-small")
prompt = "corregir español: el casa es grande"
input_ids = tokenizer(prompt, return_tensors="np", padding="max_length", max_length=256, truncation=True)["input_ids"]
corregir <language>: <text> EX: corregir ingles: .....tokenizer.decode.