You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
/// Verify that the model in the task JSON is allowed based on the huggingface whitelists.
13
11
pubfnverify_task(task:&Value) ->Result<(),Error>{
14
12
let task_model =matchget_model_name(task){
15
13
Some(model) => model.to_string(),
16
14
None =>returnOk(()),
17
15
};
18
-
let whitelisted_models =config_csv_list(CONFIG_HF_WHITELIST);
16
+
let whitelisted_models =config_csv_list(&PGML_HF_WHITELIST);
19
17
20
18
let model_is_allowed = whitelisted_models.is_empty() || whitelisted_models.contains(&task_model);
21
19
if !model_is_allowed{
22
-
bail!("model {task_model} is not whitelisted. Consider adding to{CONFIG_HF_WHITELIST} in postgresql.conf");
20
+
bail!("model {task_model} is not whitelisted. Consider adding to`pgml.huggingface_whitelist` in postgresql.conf");
23
21
}
24
22
25
23
let task_trust =get_trust_remote_code(task);
26
-
let trust_remote_code =get_config(CONFIG_HF_TRUST_REMOTE_CODE_BOOL)
27
-
.map(|v| v =="true")
28
-
.unwrap_or(true);
24
+
let trust_remote_code =PGML_HF_TRUST_REMOTE_CODE.get();
29
25
30
-
let trusted_models =config_csv_list(CONFIG_HF_TRUST_WHITELIST);
26
+
let trusted_models =config_csv_list(&PGML_HF_TRUST_REMOTE_CODE_WHITELIST);
31
27
32
28
let model_is_trusted = trusted_models.is_empty() || trusted_models.contains(&task_model);
33
29
34
30
let remote_code_allowed = trust_remote_code && model_is_trusted;
35
31
if !remote_code_allowed && task_trust ==Some(true){
36
-
bail!("model {task_model} is not trusted to run remote code. Consider setting{CONFIG_HF_TRUST_REMOTE_CODE_BOOL} = 'true' or adding {task_model} to{CONFIG_HF_TRUST_WHITELIST}");
32
+
bail!("model {task_model} is not trusted to run remote code. Consider settingpgml.huggingface_trust_remote_code = 'true' or adding {task_model} topgml.huggingface_trust_remote_code_whitelist");