Spaces:
Runtime error
Runtime error
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') |