Pisethan's picture
Create app.py
39c00be verified
raw
history blame
663 Bytes
import gradio as gr
from transformers import pipeline
# Load your fine-tuned model (ensure it's available in your Hugging Face model repository)
corrector = pipeline("text2text-generation", model="Pisethan/spelling-finetuned-model")
# Define the function for prediction
def correct_spelling(text):
result = corrector(text)[0]["generated_text"]
return result
# Create a Gradio interface
interface = gr.Interface(fn=correct_spelling, inputs="text", outputs="text",
title="Khmer Spelling Correction",
description="Enter Khmer text to correct spelling errors.")
# Launch the interface
interface.launch()