Spaces:
Sleeping
Sleeping
Commit
·
a6a9fb1
1
Parent(s):
bd82a19
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datasets import load_dataset
|
2 |
+
from evaluate import evaluator
|
3 |
+
from transformers import AutoModelForSequenceClassification, pipeline
|
4 |
+
|
5 |
+
data = load_dataset("huolongguo10/insecure").shuffle(seed=42).select(range(1000))
|
6 |
+
task_evaluator = evaluator("text-classification")
|
7 |
+
|
8 |
+
# 1. Pass a model name or path
|
9 |
+
eval_results = task_evaluator.compute(
|
10 |
+
model_or_pipeline="huolongguo10/check_sec",
|
11 |
+
data=data,
|
12 |
+
)
|
13 |
+
|
14 |
+
|
15 |
+
print(eval_results)
|