patch ollama context window error when unreachable
This commit is contained in:
parent
f6f566792d
commit
0a1a5a216a
@ -79,7 +79,9 @@ class OllamaAILLM {
|
||||
headers: authToken ? { Authorization: `Bearer ${authToken}` } : {},
|
||||
});
|
||||
|
||||
const { models } = await client.list();
|
||||
const { models } = await client.list().catch(() => ({ models: [] }));
|
||||
if (!models.length) return;
|
||||
|
||||
const infoPromises = models.map((model) =>
|
||||
client
|
||||
.show({ model: model.name })
|
||||
|
||||
Loading…
Reference in New Issue
Block a user