Myspace2 / app.py
Dmitry72's picture
init
810633e
raw
history blame
308 Bytes
import json
import gradio as gr
def image_classifier(inp):
pipe = pipeline(task='text-classification', model='s-nlp/russian_toxicity_classifier')
out = pipe(inp)
a = json.dumps(out[0])
return a
demo = gr.Interface(fn=image_classifier, inputs="text", outputs="label")
demo.launch(share=True)