Unggi commited on
Commit
f46a31f
β€’
1 Parent(s): 99a4945

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
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())