File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
examples/control-vector-generator Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -538,10 +538,10 @@ static int prepare_entries(ctrl_params & cparams) {
538
538
return persona + " " + suffix; // entry in positive/negative.txt must already be formatted i.e. "[INST] Act as if you're extremely happy. [/INST]"
539
539
};
540
540
for (size_t i = 0 ; i < positive_prompts.size (); ++i) {
541
- for (auto & cmpl : completions) {
541
+ for (size_t j = 0 ; j < completions. size () && j < cparams. n_completions ; ++j ) {
542
542
// TODO replicate the truncations done by the python implementation
543
- cparams.positive_entries .push_back (format_template (positive_prompts[i], cmpl ));
544
- cparams.negative_entries .push_back (format_template (negative_prompts[i], cmpl ));
543
+ cparams.positive_entries .push_back (format_template (positive_prompts[i], completions[j] ));
544
+ cparams.negative_entries .push_back (format_template (negative_prompts[i], completions[j] ));
545
545
}
546
546
}
547
547
return 0 ;
You can’t perform that action at this time.
0 commit comments