server : fix missing model id in /model endpoint
This commit is contained in:
parent
86bf31cfe6
commit
7a24dbe5e9
1 changed files with 4 additions and 1 deletions
|
@ -3693,11 +3693,14 @@ int main(int argc, char ** argv) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto handle_models = [¶ms, &ctx_server, &res_ok](const httplib::Request &, httplib::Response & res) {
|
const auto handle_models = [¶ms, &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", params.model_alias},
|
{"id", model_name},
|
||||||
{"object", "model"},
|
{"object", "model"},
|
||||||
{"created", std::time(0)},
|
{"created", std::time(0)},
|
||||||
{"owned_by", "llamacpp"},
|
{"owned_by", "llamacpp"},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue