geeek's picture
Update app.py
3ecebf5
raw
history blame contribute delete
393 Bytes
import gradio as gr
from detoxify import Detoxify
# each model takes in either a string or a list of strings
def greet(text):
original = Detoxify('original').predict(text)
unbiased = Detoxify('unbiased').predict(text)
return {'original':original,'unbiased':unbiased}
iface = gr.Interface(fn=greet, inputs="text", outputs="text",api_name='classify')
iface.launch(show_api='true')