Spaces:
Running
Running
The example script seems to not work
#3
by
ybelkada
- opened
Hi!
I am trying to run the example script on the model card and it seems to crash with the following error:
import evaluate
toxicity = evaluate.load("toxicity", 'DaNLP/da-electra-hatespeech-detection', module_type="measurement",)
input_texts = ["she went to the library", "he is a douchebag"]
results = toxicity.compute(predictions=input_texts)
>>> in toxicity β
β β
β 96 def toxicity(preds, toxic_classifier, toxic_label): β
β 97 β toxic_scores = [] β
β 98 β if toxic_label not in toxic_classifier.model.config.id2label.values(): β
β β± 99 β β raise ValueError( β
β 100 β β β "The `toxic_label` that you specified is not part of the model labels. Run ` β
β 101 β β ) β
β 102 β
β°βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ―
ValueError: The `toxic_label` that you specified is not part of the model labels. Run `model.config.id2label` to see what labels your model outputs.
Any help appreciated! Thanks!