Skip to content

Commit dbcf470

Browse files
committed
hellaswag : move the concat space for clarity
1 parent ab3ba64 commit dbcf470

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
@@ -392,7 +392,7 @@ void hellaswag_score(llama_context * ctx, const gpt_params & params) {
392392
hs_data[i].context = prompt_lines[idx*6];
393393
hs_data[i].gold_ending_idx = std::stoi( prompt_lines[idx*6+1] );
394394
for (size_t j=0; j < 4; j++) {
395-
hs_data[i].ending[j] = " " + prompt_lines[idx*6+2+j];
395+
hs_data[i].ending[j] = prompt_lines[idx*6+2+j];
396396
}
397397

398398
// Delete the selected random example from the prompt
@@ -417,7 +417,7 @@ void hellaswag_score(llama_context * ctx, const gpt_params & params) {
417417
size_t context_size = context_embd.size();
418418

419419
for (int i = 0; i < 4; ++i) {
420-
ending_tokens[i] = ::llama_tokenize(ctx, hs_data[task_idx].context + hs_data[task_idx].ending[i], add_bos);
420+
ending_tokens[i] = ::llama_tokenize(ctx, hs_data[task_idx].context + " " + hs_data[task_idx].ending[i], add_bos);
421421
for (int k = 0; k < int(context_size); ++k) {
422422
if (ending_tokens[i][k] != context_embd[k]) {
423423
fprintf(stderr, "Oops: ending %d of task %d differs from context at position %d\n",i,int(task_idx),k);

0 commit comments

Comments
 (0)