Skip to content

Commit 393f8d9

Browse files
committed
llama : remove llama_constraint
ggml-ci
1 parent 8f2d028 commit 393f8d9

File tree

19 files changed

+958
-993
lines changed

19 files changed

+958
-993
lines changed

common/common.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -841,15 +841,15 @@ bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_pa
841841
params.defrag_thold = std::stof(argv[i]);
842842
return true;
843843
}
844-
if (arg == "--samplers" || arg == "--constraints") {
844+
if (arg == "--samplers") {
845845
CHECK_ARG
846-
const auto constraint_names = string_split(argv[i], ';');
847-
sparams.constraints = gpt_constraint_types_from_names(constraint_names, true);
846+
const auto sampler_names = string_split(argv[i], ';');
847+
sparams.samplers = gpt_sampler_types_from_names(sampler_names, true);
848848
return true;
849849
}
850850
if (arg == "--sampling-seq") {
851851
CHECK_ARG
852-
sparams.constraints = gpt_constraint_types_from_chars(argv[i]);
852+
sparams.samplers = gpt_sampler_types_from_chars(argv[i]);
853853
return true;
854854
}
855855
if (arg == "--top-p") {
@@ -1696,13 +1696,13 @@ bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_pa
16961696
void gpt_params_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
16971697
const auto & sparams = params.sparams;
16981698

1699-
std::string constraint_type_chars;
1700-
std::string constraint_type_names;
1701-
for (const auto & constraint : sparams.constraints) {
1702-
constraint_type_chars += gpt_constraint_type_to_chr(constraint);
1703-
constraint_type_names += gpt_constraint_type_to_str(constraint) + ";";
1699+
std::string sampler_type_chars;
1700+
std::string sampler_type_names;
1701+
for (const auto & sampler : sparams.samplers) {
1702+
sampler_type_chars += gpt_sampler_type_to_chr(sampler);
1703+
sampler_type_names += gpt_sampler_type_to_str(sampler) + ";";
17041704
}
1705-
constraint_type_names.pop_back();
1705+
sampler_type_names.pop_back();
17061706

17071707
struct option_info {
17081708
LLAMA_COMMON_ATTRIBUTE_FORMAT(4, 5)
@@ -1816,9 +1816,9 @@ void gpt_params_print_usage(int /*argc*/, char ** argv, const gpt_params & param
18161816
options.push_back({ "sampling" });
18171817
options.push_back({ "*", "-s, --seed SEED", "RNG seed (default: %d, use random seed for < 0)", sparams.seed });
18181818
options.push_back({ "*", " --samplers SAMPLERS", "samplers that will be used for generation in the order, separated by \';\'\n"
1819-
"(default: %s)", constraint_type_names.c_str() });
1819+
"(default: %s)", sampler_type_names.c_str() });
18201820
options.push_back({ "*", " --sampling-seq SEQUENCE",
1821-
"simplified sequence for samplers that will be used (default: %s)", constraint_type_chars.c_str() });
1821+
"simplified sequence for samplers that will be used (default: %s)", sampler_type_chars.c_str() });
18221822
options.push_back({ "*", " --ignore-eos", "ignore end of stream token and continue generating (implies --logit-bias EOS-inf)" });
18231823
options.push_back({ "*", " --penalize-nl", "penalize newline tokens (default: %s)", sparams.penalize_nl ? "true" : "false" });
18241824
options.push_back({ "*", " --temp T", "temperature (default: %.1f)", (double)sparams.temp });

0 commit comments

Comments
 (0)