SeyedAli's picture
Update app.py
38374c4
raw
history blame
546 Bytes
import gradio as gr
import torch
from transformers import AutoModelForSequenceClassification,AutoTokenizer,pipeline
model = AutoModelForSequenceClassification.from_pretrained('SeyedAli/Persian-Text-Sentiment-Bert-V1')
tokenizer = AutoTokenizer.from_pretrained('SeyedAli/Persian-Text-Sentiment-Bert-V1')
def Sentiment(text):
pipline = pipeline(task="text-classification", model=model, tokenizer=tokenizer)
output=pipline(text)
return output
iface = gr.Interface(fn=Sentiment, inputs="text", outputs="text")
iface.launch(share=False)