Update assets/js/calibration.js
Browse files- assets/js/calibration.js +7 -8
assets/js/calibration.js
CHANGED
@@ -50,8 +50,7 @@ $(document).ready(function(){
|
|
50 |
step: 20,
|
51 |
min: 0,
|
52 |
max: 200,
|
53 |
-
value:
|
54 |
-
disabled: true,
|
55 |
create: function() {ts_handle.text($(this).slider("value"));},
|
56 |
slide: function( event, ui ) {ts_handle.text(ui.value);diagram.src = updateFigurePath($('#gradient-norm-slider').slider("option", "value"),ui.value);},
|
57 |
});
|
@@ -73,8 +72,8 @@ $(document).ready(function(){
|
|
73 |
var asr_lrl_zh_CN=jailbreak_results[cur_defense][cur_model]["lrl_zh-CN"][ppl_threshold.toString()]["tpr"];
|
74 |
var asr_lrl_sv=jailbreak_results[cur_defense][cur_model]["lrl_sv"][ppl_threshold.toString()]["tpr"];
|
75 |
var asr=(asr_gcg+asr_autodan+asr_pair+asr_tap+asr_base64+(asr_lrl_de+asr_lrl_fr+asr_lrl_zh_CN+asr_lrl_sv)/4)/6
|
76 |
-
asr_board.innerText = parseFloat(asr).toFixed(
|
77 |
-
brr_board.innerText = parseFloat(jailbreak_results[cur_defense][cur_model]["pair"][ppl_threshold.toString()]["fpr"]).toFixed(
|
78 |
return "demo_results/ppl_"+cur_model+"_threshold_"+ppl_threshold.toString()+".png"
|
79 |
}
|
80 |
else if (cur_defense === "gradient_cuff")
|
@@ -89,8 +88,8 @@ $(document).ready(function(){
|
|
89 |
var asr_lrl_zh_CN=jailbreak_results[cur_defense][cur_model]["lrl_zh-CN"][gradient_norm_threshold.toString()]["tpr"];
|
90 |
var asr_lrl_sv=jailbreak_results[cur_defense][cur_model]["lrl_sv"][gradient_norm_threshold.toString()]["tpr"];
|
91 |
var asr=(asr_gcg+asr_autodan+asr_pair+asr_tap+asr_base64+(asr_lrl_de+asr_lrl_fr+asr_lrl_zh_CN+asr_lrl_sv)/4)/6
|
92 |
-
asr_board.innerText = parseFloat(asr).toFixed(
|
93 |
-
brr_board.innerText = parseFloat(jailbreak_results[cur_defense][cur_model]["pair"][gradient_norm_threshold.toString()]["fpr"]).toFixed(
|
94 |
return "demo_results/gradient_cuff_"+cur_model+"_threshold_"+gradient_norm_threshold.toString()+".png"
|
95 |
}else{
|
96 |
var asr_gcg=jailbreak_results[cur_defense][cur_model]["adv_harmful_behavior"]["tpr"];
|
@@ -103,8 +102,8 @@ $(document).ready(function(){
|
|
103 |
var asr_lrl_zh_CN=jailbreak_results[cur_defense][cur_model]["lrl_zh-CN"]["tpr"];
|
104 |
var asr_lrl_sv=jailbreak_results[cur_defense][cur_model]["lrl_sv"]["tpr"];
|
105 |
var asr=(asr_gcg+asr_autodan+asr_pair+asr_tap+asr_base64+(asr_lrl_de+asr_lrl_fr+asr_lrl_zh_CN+asr_lrl_sv)/4)/6
|
106 |
-
asr_board.innerText = parseFloat(asr).toFixed(
|
107 |
-
brr_board.innerText = parseFloat(jailbreak_results[cur_defense][cur_model]["pair"]["fpr"]).toFixed(
|
108 |
return "demo_results/"+cur_defense+"_"+cur_model+".png"
|
109 |
}
|
110 |
}
|
|
|
50 |
step: 20,
|
51 |
min: 0,
|
52 |
max: 200,
|
53 |
+
value: 100,
|
|
|
54 |
create: function() {ts_handle.text($(this).slider("value"));},
|
55 |
slide: function( event, ui ) {ts_handle.text(ui.value);diagram.src = updateFigurePath($('#gradient-norm-slider').slider("option", "value"),ui.value);},
|
56 |
});
|
|
|
72 |
var asr_lrl_zh_CN=jailbreak_results[cur_defense][cur_model]["lrl_zh-CN"][ppl_threshold.toString()]["tpr"];
|
73 |
var asr_lrl_sv=jailbreak_results[cur_defense][cur_model]["lrl_sv"][ppl_threshold.toString()]["tpr"];
|
74 |
var asr=(asr_gcg+asr_autodan+asr_pair+asr_tap+asr_base64+(asr_lrl_de+asr_lrl_fr+asr_lrl_zh_CN+asr_lrl_sv)/4)/6
|
75 |
+
asr_board.innerText = parseFloat(asr).toFixed(3);
|
76 |
+
brr_board.innerText = parseFloat(jailbreak_results[cur_defense][cur_model]["pair"][ppl_threshold.toString()]["fpr"]).toFixed(3);
|
77 |
return "demo_results/ppl_"+cur_model+"_threshold_"+ppl_threshold.toString()+".png"
|
78 |
}
|
79 |
else if (cur_defense === "gradient_cuff")
|
|
|
88 |
var asr_lrl_zh_CN=jailbreak_results[cur_defense][cur_model]["lrl_zh-CN"][gradient_norm_threshold.toString()]["tpr"];
|
89 |
var asr_lrl_sv=jailbreak_results[cur_defense][cur_model]["lrl_sv"][gradient_norm_threshold.toString()]["tpr"];
|
90 |
var asr=(asr_gcg+asr_autodan+asr_pair+asr_tap+asr_base64+(asr_lrl_de+asr_lrl_fr+asr_lrl_zh_CN+asr_lrl_sv)/4)/6
|
91 |
+
asr_board.innerText = parseFloat(asr).toFixed(3);
|
92 |
+
brr_board.innerText = parseFloat(jailbreak_results[cur_defense][cur_model]["pair"][gradient_norm_threshold.toString()]["fpr"]).toFixed(3);
|
93 |
return "demo_results/gradient_cuff_"+cur_model+"_threshold_"+gradient_norm_threshold.toString()+".png"
|
94 |
}else{
|
95 |
var asr_gcg=jailbreak_results[cur_defense][cur_model]["adv_harmful_behavior"]["tpr"];
|
|
|
102 |
var asr_lrl_zh_CN=jailbreak_results[cur_defense][cur_model]["lrl_zh-CN"]["tpr"];
|
103 |
var asr_lrl_sv=jailbreak_results[cur_defense][cur_model]["lrl_sv"]["tpr"];
|
104 |
var asr=(asr_gcg+asr_autodan+asr_pair+asr_tap+asr_base64+(asr_lrl_de+asr_lrl_fr+asr_lrl_zh_CN+asr_lrl_sv)/4)/6
|
105 |
+
asr_board.innerText = parseFloat(asr).toFixed(3);
|
106 |
+
brr_board.innerText = parseFloat(jailbreak_results[cur_defense][cur_model]["pair"]["fpr"]).toFixed(3);
|
107 |
return "demo_results/"+cur_defense+"_"+cur_model+".png"
|
108 |
}
|
109 |
}
|