import gradio as gr from transformers import pipeline model = pipeline("text2text-generation", model="asimokby/Turkish-GPT-GEC-v0") def generate_text(prompt): return model(prompt, max_length=500)[0]['generated_text'] # Description and title description = """This application is a demo for our Turkish Grammar Error Correction model. Please enter text in Turkish, and it will provide you with corrected output. For more information, check out the paper: [Paper Link](https://arxiv.org/pdf/2405.15320)""" title = "Turkish Grammar Assistant" input_box = gr.Textbox(lines=20, label="Input Text") # Increase lines for input output_box = gr.Textbox(lines=20, label="Output Text", interactive=True) # Increase lines for output iface = gr.Interface(fn=generate_text, inputs=input_box, outputs=output_box, title="Turkish Grammar Assistant", description=description) iface.launch()