Get Grammatical corrections on your English text, trained on a subset of c4-200m dataset - ONNX Quantized Model
Use the below code for running the model
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"])
- Downloads last month
- 4
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.