Downloads · 30 days
14
3% of all-time downloads
leslyarun/grammatical-error-correction-quantized
grammatical-error-correction-quantized is a machine learning model from leslyarun. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
14
3% of all-time downloads
All-time downloads
511
Public
Repo size
645 MB
Likes
1
Public
Click a slice to open those files.
.onnx644 MB · 100%
From the Hugging Face model README
from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSeq2SeqLM
from optimum.pipelines import pipeline
tokenizer = AutoTokenizer.from_pretrained("leslyarun/grammatical-error-correction-quantized")
model = ORTModelForSeq2SeqLM.from_pretrained("leslyarun/grammatical-error-correction-quantized",
encoder_file_name="encoder_model_quantized.onnx",
decoder_file_name="decoder_model_quantized.onnx",
decoder_with_past_file_name="decoder_with_past_model_quantized.onnx")
text2text_generator = pipeline("text2text-generation", model=model, tokenizer=tokenizer)
output = text2text_generator("grammar: " + sentence)
print(output[0]["generated_text"])