perplexity.cpp : clean up

This commit is contained in:
klosax 2023-07-25 17:57:15 +02:00 committed by GitHub
parent ae4d116bdf
commit fae04ddd97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -159,8 +159,9 @@ void hellaswag_score(llama_context * ctx, const gpt_params & params) {
bool prepend_bos = true; bool prepend_bos = true;
// Number of examples to use when computing the score // Number of examples to use when computing the score
if ( params.hellaswag_tasks < hs_task_count ) if ( params.hellaswag_tasks < hs_task_count ) {
hs_task_count = params.hellaswag_tasks; hs_task_count = params.hellaswag_tasks;
}
// The examples should be randomized so the score stabilizes quickly. // The examples should be randomized so the score stabilizes quickly.
bool randomize_tasks = true; bool randomize_tasks = true;
@ -196,7 +197,7 @@ void hellaswag_score(llama_context * ctx, const gpt_params & params) {
hs_data[i].ending[j] = " " + prompt_lines[idx*6+2+j]; hs_data[i].ending[j] = " " + prompt_lines[idx*6+2+j];
} }
// Delete the select random example from the prompt // Delete the selected random example from the prompt
if (randomize_tasks) { if (randomize_tasks) {
prompt_lines.erase( std::next(prompt_lines.begin(),idx*6) , std::next(prompt_lines.begin(),idx*6+6) ); prompt_lines.erase( std::next(prompt_lines.begin(),idx*6) , std::next(prompt_lines.begin(),idx*6+6) );
} }