Spaces:
Sleeping
Sleeping
stats-dev
commited on
Commit
•
7a4f989
1
Parent(s):
61d8616
test2
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
# Load model directly
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
|
4 |
tokenizer = AutoTokenizer.from_pretrained("j5ng/kcbert-formal-classifier")
|
@@ -6,3 +7,9 @@ model = AutoModelForSequenceClassification.from_pretrained("j5ng/kcbert-formal-c
|
|
6 |
|
7 |
formal_classifier = pipeline(task="text-classification", model=model, tokenizer=tokenizer)
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Load model directly
|
2 |
+
import gradio as gr
|
3 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
4 |
|
5 |
tokenizer = AutoTokenizer.from_pretrained("j5ng/kcbert-formal-classifier")
|
|
|
7 |
|
8 |
formal_classifier = pipeline(task="text-classification", model=model, tokenizer=tokenizer)
|
9 |
|
10 |
+
|
11 |
+
def greet(name):
|
12 |
+
return formal_classifier(name)
|
13 |
+
|
14 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
15 |
+
iface.launch()
|