From e445aeec14cc2eb8b641469910aa55141d79361a Mon Sep 17 00:00:00 2001 From: kingbri Date: Thu, 23 Nov 2023 00:09:58 -0500 Subject: [PATCH] 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 --- public/index.html | 2 +- server.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index c7c65dcaa..cc3ad9163 100644 --- a/public/index.html +++ b/public/index.html @@ -1513,7 +1513,7 @@ - + diff --git a/server.js b/server.js index a07e6cb56..12375c627 100644 --- a/server.js +++ b/server.js @@ -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}`);