This commit is contained in:
Xuan Son Nguyen 2024-12-23 11:59:53 +01:00
parent 7a24dbe5e9
commit 2f40ed013b

View file

@ -3693,14 +3693,11 @@ int main(int argc, char ** argv) {
}; };
const auto handle_models = [&params, &ctx_server, &res_ok](const httplib::Request &, httplib::Response & res) { const auto handle_models = [&params, &ctx_server, &res_ok](const httplib::Request &, httplib::Response & res) {
std::string model_name = ctx_server.params_base.model_alias.empty()
? ctx_server.params_base.model
: ctx_server.params_base.model_alias;
json models = { json models = {
{"object", "list"}, {"object", "list"},
{"data", { {"data", {
{ {
{"id", model_name}, {"id", params.model_alias.empty() ? params.model : params.model_alias},
{"object", "model"}, {"object", "model"},
{"created", std::time(0)}, {"created", std::time(0)},
{"owned_by", "llamacpp"}, {"owned_by", "llamacpp"},