Spaces:
Runtime error
Runtime error
remove extra tabs
Browse files
app.py
CHANGED
|
@@ -13,17 +13,17 @@ txt = st.text_area("Text to analyze", defaultTxt)
|
|
| 13 |
# Huggingface does not support Python 3.10 match statements and I'm too lazy to implement an equivalent.
|
| 14 |
|
| 15 |
if (option == "RoBERTa"):
|
| 16 |
-
|
| 17 |
-
|
| 18 |
elif (option == "DistilBERT"):
|
| 19 |
-
|
| 20 |
-
|
| 21 |
elif (option == "XLM-RoBERTa"):
|
| 22 |
-
|
| 23 |
-
|
| 24 |
else:
|
| 25 |
-
|
| 26 |
-
|
| 27 |
|
| 28 |
tokenizer = AutoTokenizer.from_pretrained(tokenizerPath)
|
| 29 |
model = AutoModelForSequenceClassification.from_pretrained(modelPath)
|
|
|
|
| 13 |
# Huggingface does not support Python 3.10 match statements and I'm too lazy to implement an equivalent.
|
| 14 |
|
| 15 |
if (option == "RoBERTa"):
|
| 16 |
+
tokenizerPath = "s-nlp/roberta_toxicity_classifier"
|
| 17 |
+
modelPath = "s-nlp/roberta_toxicity_classifier"
|
| 18 |
elif (option == "DistilBERT"):
|
| 19 |
+
tokenizerPath = "citizenlab/distilbert-base-multilingual-cased-toxicity"
|
| 20 |
+
modelPath = "citizenlab/distilbert-base-multilingual-cased-toxicity"
|
| 21 |
elif (option == "XLM-RoBERTa"):
|
| 22 |
+
tokenizerPath = "unitary/multilingual-toxic-xlm-roberta"
|
| 23 |
+
modelPath = "unitary/multilingual-toxic-xlm-roberta"
|
| 24 |
else:
|
| 25 |
+
tokenizerPath = "s-nlp/roberta_toxicity_classifier"
|
| 26 |
+
modelPath = "s-nlp/roberta_toxicity_classifier"
|
| 27 |
|
| 28 |
tokenizer = AutoTokenizer.from_pretrained(tokenizerPath)
|
| 29 |
model = AutoModelForSequenceClassification.from_pretrained(modelPath)
|