File size: 887 Bytes
dece60c
 
 
 
 
 
 
 
 
2ec4c62
 
 
 
dece60c
2ec4c62
 
 
 
 
 
dece60c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()