Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
|
5 |
+
## Widget Inference
|
6 |
+
|
7 |
+
Anda dapat mencoba model ini langsung di sini:
|
8 |
+
|
9 |
+
**(Ganti `username/grammar-corrector-t5` dengan nama model Anda)**
|
10 |
+
|
11 |
+
import gradio as gr
|
12 |
+
from transformers import pipeline
|
13 |
+
|
14 |
+
# Load model
|
15 |
+
corrector = pipeline("text2text-generation", model="username/grammar-corrector-t5")
|
16 |
+
|
17 |
+
# Buat antarmuka Gradio
|
18 |
+
def correct_grammar(text):
|
19 |
+
return corrector(text)[0]["generated_text"]
|
20 |
+
|
21 |
+
iface = gr.Interface(
|
22 |
+
fn=correct_grammar,
|
23 |
+
inputs=gr.Textbox(lines=5, placeholder="Masukkan teks di sini..."),
|
24 |
+
outputs=gr.Textbox(lines=5),
|
25 |
+
)
|
26 |
+
|
27 |
+
iface.launch()
|
28 |
+
|