This commit is contained in:
Timothy J. Baek
2024-05-24 02:17:48 -07:00
parent 404875cab9
commit e80e4c304a
14 changed files with 49 additions and 60 deletions

View File

@@ -7,7 +7,7 @@
import { goto } from '$app/navigation';
import { getAllModels as _getAllModels } from '$lib/utils';
import { getModels as _getModels } from '$lib/apis';
import { getOllamaVersion } from '$lib/apis/ollama';
import { getPrompts } from '$lib/apis/prompts';
@@ -45,8 +45,8 @@
let showShortcuts = false;
const getAllModels = async () => {
return _getAllModels(localStorage.token);
const getModels = async () => {
return _getModels(localStorage.token);
};
onMount(async () => {
@@ -75,7 +75,7 @@
await Promise.all([
(async () => {
models.set(await getAllModels());
models.set(await getModels());
})(),
(async () => {
prompts.set(await getPrompts(localStorage.token));

View File

@@ -8,7 +8,7 @@
import { splitStream } from '$lib/utils';
import { onMount, tick, getContext } from 'svelte';
import { createModel } from '$lib/apis/ollama';
import { addNewModel, getModelById, getModels } from '$lib/apis/models';
import { addNewModel, getModelById, getModelInfos } from '$lib/apis/models';
const i18n = getContext('i18n');
@@ -99,7 +99,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
const saveModelfile = async (modelfile) => {
await addNewModel(localStorage.token, modelfile);
await modelfiles.set(await getModels(localStorage.token));
await modelfiles.set(await getModelInfos(localStorage.token));
};
const submitHandler = async () => {

View File

@@ -10,7 +10,7 @@
import { splitStream } from '$lib/utils';
import { createModel } from '$lib/apis/ollama';
import { getModels, updateModelById } from '$lib/apis/models';
import { getModelInfos, updateModelById } from '$lib/apis/models';
import AdvancedParams from '$lib/components/chat/Settings/Advanced/AdvancedParams.svelte';
@@ -86,7 +86,7 @@
const updateModelfile = async (modelfile) => {
await updateModelById(localStorage.token, modelfile.tagName, modelfile);
await modelfiles.set(await getModels(localStorage.token));
await modelfiles.set(await getModelInfos(localStorage.token));
};
const updateHandler = async () => {