Fixed code style

This commit is contained in:
MaggotHATE 2023-12-02 20:52:56 +05:00
parent e115b5ab3c
commit ff8adc1196

View file

@ -104,30 +104,12 @@ std::string llama_sampling_order_print(const llama_sampling_params & params) {
if (params.mirostat == 0){ if (params.mirostat == 0){
for (auto s : params.samplers_sequence){ for (auto s : params.samplers_sequence){
switch (s){ switch (s){
case 'k':{ case 'k': result += "-> top_k "; break;
result += "-> top_k "; case 'f': result += "-> tfs_z "; break;
break; case 'y': result += "-> typical_p "; break;
} case 'p': result += "-> top_p "; break;
case 'f':{ case 'm': result += "-> min_p "; break;
result += "-> tfs_z "; case 't': result += "-> temp "; break;
break;
}
case 'y':{
result += "-> typical_p ";
break;
}
case 'p':{
result += "-> top_p ";
break;
}
case 'm':{
result += "-> min_p ";
break;
}
case 't':{
result += "-> temp ";
break;
}
default : break; default : break;
} }
} }
@ -154,34 +136,15 @@ void sampler_queue(
for (auto s : samplers_sequence){ for (auto s : samplers_sequence){
switch (s){ switch (s){
case 'k':{ case 'k': llama_sample_top_k (ctx_main, &cur_p, top_k, min_keep); break;
llama_sample_top_k (ctx_main, &cur_p, top_k, min_keep); case 'f': llama_sample_tail_free(ctx_main, &cur_p, tfs_z, min_keep); break;
break; case 'y': llama_sample_typical (ctx_main, &cur_p, typical_p, min_keep); break;
} case 'p': llama_sample_top_p (ctx_main, &cur_p, top_p, min_keep); break;
case 'f':{ case 'm': llama_sample_min_p (ctx_main, &cur_p, min_p, min_keep); break;
llama_sample_tail_free(ctx_main, &cur_p, tfs_z, min_keep); case 't': llama_sample_temp (ctx_main, &cur_p, temp); break;
break;
}
case 'y':{
llama_sample_typical (ctx_main, &cur_p, typical_p, min_keep);
break;
}
case 'p':{
llama_sample_top_p (ctx_main, &cur_p, top_p, min_keep);
break;
}
case 'm':{
llama_sample_min_p (ctx_main, &cur_p, min_p, min_keep);
break;
}
case 't':{
llama_sample_temp (ctx_main, &cur_p, temp);
break;
}
default : break; default : break;
} }
} }
} }
llama_token llama_sampling_sample( llama_token llama_sampling_sample(