Spaces:
Runtime error
Runtime error
File size: 546 Bytes
617d6e7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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) |