MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / to_ini

Method to_ini

subprojects/llama.cpp/common/preset.cpp:105–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105std::string common_preset::to_ini() const {
106 std::ostringstream ss;
107
108 ss << "[" << name << "]\n";
109 for (const auto & [opt, value] : options) {
110 auto espaced_value = value;
111 string_replace_all(espaced_value, "\n", "\\\n");
112 ss << rm_leading_dashes(opt.args.back()) << " = ";
113 ss << espaced_value << "\n";
114 }
115 ss << "\n";
116
117 return ss.str();
118}
119
120void common_preset::set_option(const common_preset_context & ctx, const std::string & env, const std::string & value) {
121 // try if option exists, update it

Callers 2

init_routesMethod · 0.80

Calls 3

rm_leading_dashesFunction · 0.85
string_replace_allFunction · 0.70
strMethod · 0.45

Tested by

no test coverage detected