Rob Caamano
commited on
Commit
•
f1865c0
1
Parent(s):
ebebffc
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,8 @@ submit = False
|
|
23 |
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)
|
|
|
23 |
model_name = ""
|
24 |
|
25 |
model_mapping = {
|
26 |
+
"Toxicity - 1 Epoch": "RobCaamano/toxicity",
|
27 |
+
"Toxicity - 8 Epochs": "RobCaamano/toxicity_update",
|
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_update"]:
|
51 |
classes = {k: results[k] for k in results.keys() if not k == "toxic"}
|
52 |
|
53 |
max_class = max(classes, key=classes.get)
|