File size: 532 Bytes
61d8616
7a4f989
c9fd2e0
be5e682
61d8616
 
 
 
be5e682
7a4f989
 
 
 
fa1a7fd
7a4f989
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Load model directly
import gradio as gr
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline

tokenizer = AutoTokenizer.from_pretrained("j5ng/kcbert-formal-classifier")
model = AutoModelForSequenceClassification.from_pretrained("j5ng/kcbert-formal-classifier")

formal_classifier = pipeline(task="text-classification", model=model, tokenizer=tokenizer)


def greet(name):
    return formal_classifier(name)

print("test")
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()