ColeGuion commited on
Commit
dca9cd6
1 Parent(s): d3ea324

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ def correct_text(text):
5
+ model_id = "grammarly/coedit-large"
6
+ pipe = pipeline("text2text-generation", model=model_id)
7
+ corrected = pipe(text)[0]['generated_text']
8
+ return corrected
9
+
10
+ interface = gr.Interface(fn=correct_text, inputs="text_area", outputs="text")
11
+ interface.launch()