|
18 | 18 | #include <algorithm>
|
19 | 19 | #include <iostream>
|
20 | 20 | #include <fstream>
|
| 21 | +#include <climits> |
21 | 22 |
|
22 | 23 |
|
23 | 24 | //////////////////////////////////////////////////
|
@@ -244,7 +245,7 @@ struct train_context {
|
244 | 245 |
|
245 | 246 | struct ctrl_params {
|
246 | 247 | /* default meta parameters */
|
247 |
| - int n_completions = 64; |
| 248 | + int n_completions = INT_MAX; |
248 | 249 | int n_pca_batch = 5;
|
249 | 250 | int n_pca_iterations = 1000;
|
250 | 251 |
|
@@ -538,7 +539,7 @@ static int prepare_entries(ctrl_params & cparams) {
|
538 | 539 | return persona + " " + suffix; // entry in positive/negative.txt must already be formatted i.e. "[INST] Act as if you're extremely happy. [/INST]"
|
539 | 540 | };
|
540 | 541 | for (size_t i = 0; i < positive_prompts.size(); ++i) {
|
541 |
| - for (size_t j = 0; j < completions.size() && j < cparams.n_completions; ++j) { |
| 542 | + for (int j = 0; j < std::min((int) completions.size(), cparams.n_completions); ++j) { |
542 | 543 | // TODO replicate the truncations done by the python implementation
|
543 | 544 | cparams.positive_entries.push_back(format_template(positive_prompts[i], completions[j]));
|
544 | 545 | cparams.negative_entries.push_back(format_template(negative_prompts[i], completions[j]));
|
@@ -606,7 +607,7 @@ int main(int argc, char ** argv) {
|
606 | 607 | cb_data.n_tokens = t.max_seq_len;
|
607 | 608 |
|
608 | 609 | printf("Evaluating prompt[%ld/%ld]: \"%s\" - \"%s\" (%ld tokens)\n",
|
609 |
| - i+1, t.tokens_pos.size(), |
| 610 | + i+1, cparams.positive_entries.size(), |
610 | 611 | tokens_to_str(ctx, t.tokens_pos.cbegin(), t.tokens_pos.cend()).c_str(),
|
611 | 612 | tokens_to_str(ctx, t.tokens_neg.cbegin(), t.tokens_neg.cend()).c_str(),
|
612 | 613 | t.max_seq_len);
|
|
0 commit comments