diff options
author | klosax <131523366+klosax@users.noreply.github.com> | 2023-07-28 20:25:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 21:25:36 +0300 |
commit | 8a88e5855c3b93024be0f93290b01a4206b65b38 (patch) | |
tree | 6494ed8d1db51be2ce59db0378429f75cb7eab92 /examples/common.cpp | |
parent | a9559bf77b903d94eb21614ceae5ae8950f0f1fc (diff) |
perplexity : add Hellaswag calculation (#2389)
* common.h : add hellaswag / remove perplexity-lines
* common.cpp : add hellaswag / remove perplexity-lines
* perplexity.cpp : add hellswag scores / remove perplexity-lines
* perplexity.cpp : clean up
* common.h : change default param value
* common.cpp : Change default param
* perplexity.cpp : alter wording
* common.h : alter wording
* common.cpp : alter wording
Diffstat (limited to 'examples/common.cpp')
-rw-r--r-- | examples/common.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/examples/common.cpp b/examples/common.cpp index dd964c8a..fe7308b1 100644 --- a/examples/common.cpp +++ b/examples/common.cpp @@ -402,8 +402,14 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) { params.antiprompt.push_back(argv[i]); } else if (arg == "--perplexity") { params.perplexity = true; - } else if (arg == "--perplexity-lines") { - params.perplexity_lines = true; + } else if (arg == "--hellaswag") { + params.hellaswag = true; + } else if (arg == "--hellaswag-tasks") { + if (++i >= argc) { + invalid_param = true; + break; + } + params.hellaswag_tasks = std::stoi(argv[i]); } else if (arg == "--ignore-eos") { params.logit_bias[llama_token_eos()] = -INFINITY; } else if (arg == "--no-penalize-nl") { @@ -559,8 +565,9 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) { fprintf(stdout, " not recommended: doubles context memory required and no measurable increase in quality\n"); fprintf(stdout, " --temp N temperature (default: %.1f)\n", (double)params.temp); fprintf(stdout, " --perplexity compute perplexity over each ctx window of the prompt\n"); - fprintf(stdout, " --perplexity-lines compute perplexity over each line of the prompt\n"); - fprintf(stdout, " --keep number of tokens to keep from the initial prompt (default: %d, -1 = all)\n", params.n_keep); + fprintf(stdout, " --hellaswag compute HellaSwag score over random tasks from datafile supplied with -f\n"); + fprintf(stdout, " --hellaswag-tasks N number of tasks to use when computing the HellaSwag score (default: %d)\n", params.hellaswag_tasks); + fprintf(stdout, " --keep N number of tokens to keep from the initial prompt (default: %d, -1 = all)\n", params.n_keep); fprintf(stdout, " --chunks N max number of chunks to process (default: %d, -1 = all)\n", params.n_chunks); if (llama_mlock_supported()) { fprintf(stdout, " --mlock force system to keep model in RAM rather than swapping or compressing\n"); |