sillyname / app.py
Jerimee's picture
improve desc
1dd8f74
import gradio as gr
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
tokenizer = AutoTokenizer.from_pretrained("Jerimee/autotrain-dontknowwhatImdoing-980432459")
model = AutoModelForSequenceClassification.from_pretrained("Jerimee/autotrain-dontknowwhatImdoing-980432459")
# I don't know what Im doing
#sentiment = pipeline("text-classification", model=model, tokenizer=tokenizer)
classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
#outputs = model( **kwargs )
#inputs = "text",
#outputs = ['text'],
def get_sentiment(input_text):
return classifier(input_text)
iface = gr.Interface(
fn = get_sentiment,
inputs = "text",
outputs = ['text'],
title = 'Silly Name',
description = 'Enter a name. Thing tells you if the name is a silly goblin name, or a respectable human name. For the moment it actually seems to work.',
btn = gr.Button("Run"),
css="app.css",
examples=[
["Jerimee"],
["Blastnock"],
["Mary"],
["Hwan"],
["Amir"],
["Darnell"],
["Clubrubble"]
]
)
iface.launch() #inline = False