Spaces:
Runtime error
Runtime error
Jeffrey Rathgeber Jr
commited on
test
Browse files
app.py
CHANGED
@@ -113,11 +113,11 @@ if option == 'MILESTONE 3':
|
|
113 |
df = df.assign(Highest_Toxicity_Class_Except_Toxic=HTCET)
|
114 |
df = df.assign(Score_Except_Toxic=SET)
|
115 |
|
116 |
-
X_train =
|
117 |
batch = tokenizers[0](X_train, padding=True, truncation=True, max_length=512, return_tensors="pt")
|
118 |
|
119 |
with torch.no_grad():
|
120 |
-
outputs = models[0](
|
121 |
predictions = F.softmax(outputs.logits, dim=1)
|
122 |
labels = torch.argmax(predictions, dim=1)
|
123 |
labels = [model.config.id2label[label_id] for label_id in labels.tolist()]
|
|
|
113 |
df = df.assign(Highest_Toxicity_Class_Except_Toxic=HTCET)
|
114 |
df = df.assign(Score_Except_Toxic=SET)
|
115 |
|
116 |
+
X_train = 'I dont anonymously edit articles at all.'
|
117 |
batch = tokenizers[0](X_train, padding=True, truncation=True, max_length=512, return_tensors="pt")
|
118 |
|
119 |
with torch.no_grad():
|
120 |
+
outputs = models[0](batch, labels=torch.tensor([1, 0]))
|
121 |
predictions = F.softmax(outputs.logits, dim=1)
|
122 |
labels = torch.argmax(predictions, dim=1)
|
123 |
labels = [model.config.id2label[label_id] for label_id in labels.tolist()]
|