Unverified Commit 5ec20c1a authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #24 from ollama-webui/dev

fix: make sure settings model exists
parents 51874cfa 2095d4ab
......@@ -39,7 +39,10 @@
settings = JSON.parse(settings);
console.log(settings);
selectedModel = settings.model ?? '';
selectedModel =
settings.model && models.map((model) => model.name).includes(settings.model)
? settings.model
: '';
system = settings.system ?? null;
temperature = settings.temperature ?? null;
}
......@@ -233,8 +236,8 @@
return { models: [] };
});
const data = res;
models = data.models;
console.log(res);
models = res.models ?? [];
};
const submitPrompt = async (user_prompt) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment