import gradio as gr
from transformers import pipeline

# Specify the model ID
model_id = "Canstralian/CySec_Known_Exploit_Analyzer"

# Load the model using Hugging Face's pipeline (adjust if needed)
analyzer = pipeline("text-classification", model=model_id)

# Define a function to process inputs using the model
def analyze_exploit(text):
    result = analyzer(text)
    return result

# Create a Gradio interface
interface = gr.Interface(
    fn=analyze_exploit,
    inputs=gr.Textbox(lines=2, placeholder="Enter exploit description..."),
    outputs="json",
    title="CySec Known Exploit Analyzer",
    description="Analyze known cybersecurity exploits using a Hugging Face model."
)

# Launch the Gradio interface
interface.launch()