nsfwdata / ui /gradio_ui.py
S-Dreamer's picture
Create ui/gradio_ui.py
eedf7b6 verified
raw
history blame contribute delete
523 Bytes
# ui/gradio_ui.py
import gradio as gr
from agents.nsfw_agent import NSFWMatchingAgent
agent = NSFWMatchingAgent()
def match_text_ui(text):
return agent.match(text)
demo = gr.Interface(
fn=match_text_ui,
inputs=gr.Textbox(placeholder="Enter NSFW-style prompt...", label="Your Input"),
outputs=gr.Textbox(label="Best Matching Description"),
title="NSFW Text Semantic Matcher",
description="Finds the most semantically similar NSFW description from multiple datasets.",
allow_flagging="never"
)