evaluator_cs / app.py
huolongguo10's picture
Update app.py
3eacfc7
raw
history blame
523 Bytes
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(1000))
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,
)
with gr.Blocks() as demo:
gr.JSON(eval_results)
print(eval_results)
demo.launch()