Skip to content

Commit

Permalink
server : fix missing model id in /model endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson committed Dec 23, 2024
1 parent 86bf31c commit 7a24dbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3693,11 +3693,14 @@ int main(int argc, char ** argv) {
};

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 = {
{"object", "list"},
{"data", {
{
{"id", params.model_alias},
{"id", model_name},
{"object", "model"},
{"created", std::time(0)},
{"owned_by", "llamacpp"},
Expand Down

0 comments on commit 7a24dbe

Please sign in to comment.