Skip to content

Commit ca57e0f

Browse files
perplexity : ndot progress and show stats with < 100 tasks (#7348)
Fix floating point error with ndot printing, allow end stats on lower task numbers if multiple-choice tasks.
1 parent c1b295e commit ca57e0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/perplexity/perplexity.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ static void multiple_choice_score(llama_context * ctx, const gpt_params & params
14251425
// Use all tasks
14261426
tasks.resize(n_task);
14271427
printf("%s: reading tasks", __func__);
1428-
int n_dot = n_task/100;
1428+
int n_dot = std::max((int) n_task/100, 1);
14291429
int i = 0;
14301430
for (auto& task : tasks) {
14311431
++i;
@@ -1675,7 +1675,7 @@ static void multiple_choice_score(llama_context * ctx, const gpt_params & params
16751675

16761676
llama_batch_free(batch);
16771677

1678-
if (n_done < 100) return;
1678+
if (n_done < 100 && (params.multiple_choice_tasks != 0 && params.multiple_choice_tasks < (size_t)n_task)) return;
16791679

16801680
float p = 1.f*n_correct/n_done;
16811681
float sigma = sqrt(p*(1-p)/(n_done-1));

0 commit comments

Comments
 (0)