from datasets import load_dataset from evaluate import evaluator from transformers import AutoModelForSequenceClassification, pipeline import gradio as gr data = load_dataset("huolongguo10/insecure",split="train").shuffle(seed=42).select(range(10000)) task_evaluator = evaluator("text-classification") # 1. Pass a model name or path eval_results = task_evaluator.compute( model_or_pipeline="huolongguo10/check_sec", data=data, input_column="sentence1", label_mapping={"LABEL_0": 0, "LABEL_1": 1} ) with gr.Blocks() as demo: gr.JSON(eval_results) print(eval_results) demo.launch()