Tabby: Fix model name return on error

Tabby's model API is always /v1/model/list, so return "None" if the
request fails since that means a model is most likely not loaded.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2023-11-23 00:09:58 -05:00
parent b4afb10fab
commit e445aeec14
2 changed files with 5 additions and 1 deletions

View File

@ -596,6 +596,10 @@ app.post("/api/textgenerationwebui/status", jsonParser, async function (request,
const modelName = modelInfo?.id;
result = modelName || result;
} else {
// TabbyAPI returns an error 400 if a model isn't loaded
result = "None"
}
} catch (error) {
console.error(`Failed to get TabbyAPI model info: ${error}`);