Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,6 +38,10 @@ def inference(prompt):
|
|
| 38 |
bi_prob = sigmoid(logits)
|
| 39 |
|
| 40 |
predicted_class_id = bi_prob.argmax().item()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
class_id = model.config.id2label[predicted_class_id]
|
| 42 |
|
| 43 |
return "class_id: " + str(class_id) + "\n" + "clean_prob: " + str(bi_prob[0][0].item()) + "\n" + "unclean_prob: " + str(bi_prob[0][1].item())
|
|
|
|
| 38 |
bi_prob = sigmoid(logits)
|
| 39 |
|
| 40 |
predicted_class_id = bi_prob.argmax().item()
|
| 41 |
+
|
| 42 |
+
# 임시
|
| 43 |
+
model.config.id2label = {0: 'CLEAN', 1: 'UNCLEAN'}
|
| 44 |
+
|
| 45 |
class_id = model.config.id2label[predicted_class_id]
|
| 46 |
|
| 47 |
return "class_id: " + str(class_id) + "\n" + "clean_prob: " + str(bi_prob[0][0].item()) + "\n" + "unclean_prob: " + str(bi_prob[0][1].item())
|