| 285 | } |
| 286 | |
| 287 | static std::string parse_bool_arg(const common_arg & arg, const std::string & key, const std::string & value) { |
| 288 | // if this is a negated arg, we need to reverse the value |
| 289 | for (const auto & neg_arg : arg.args_neg) { |
| 290 | if (rm_leading_dashes(neg_arg) == key) { |
| 291 | return common_arg_utils::is_truthy(value) ? "false" : "true"; |
| 292 | } |
| 293 | } |
| 294 | // otherwise, not negated |
| 295 | return value; |
| 296 | } |
| 297 | |
| 298 | common_preset_context::common_preset_context(llama_example ex, bool only_remote_allowed) |
| 299 | : ctx_params(common_params_parser_init(default_params, ex)) { |
no test coverage detected