File size: 523 Bytes
eedf7b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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"
)