formal_project / app.py
stats-dev
test
fa1a7fd
raw
history blame contribute delete
532 Bytes
# 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()