Rob Caamano
commited on
Commit
•
9cda51f
1
Parent(s):
e0c3551
Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,7 @@ model_name = ""
|
|
24 |
|
25 |
model_mapping = {
|
26 |
"Toxicity": "RobCaamano/toxicity",
|
|
|
27 |
"DistilBERT Base Uncased (SST-2)": "distilbert-base-uncased-finetuned-sst-2-english",
|
28 |
}
|
29 |
|
@@ -46,7 +47,7 @@ input = tokenizer(text, return_tensors="tf")
|
|
46 |
if submit:
|
47 |
results = dict(d.values() for d in clf(text)[0])
|
48 |
|
49 |
-
if model_name
|
50 |
classes = {k: results[k] for k in results.keys() if not k == "toxic"}
|
51 |
|
52 |
max_class = max(classes, key=classes.get)
|
|
|
24 |
|
25 |
model_mapping = {
|
26 |
"Toxicity": "RobCaamano/toxicity",
|
27 |
+
"Toxicity 2": "RobCaamano/toxicity_distilbert",
|
28 |
"DistilBERT Base Uncased (SST-2)": "distilbert-base-uncased-finetuned-sst-2-english",
|
29 |
}
|
30 |
|
|
|
47 |
if submit:
|
48 |
results = dict(d.values() for d in clf(text)[0])
|
49 |
|
50 |
+
if model_name in ["RobCaamano/toxicity", "RobCaamano/toxicity_distilbert"]:
|
51 |
classes = {k: results[k] for k in results.keys() if not k == "toxic"}
|
52 |
|
53 |
max_class = max(classes, key=classes.get)
|