Spaces:
Build error
Build error
Create app.py
Browse files
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()
|