Commit 098ba6ea authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

refac: frontend

parent 582d11f1
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
k: 4 k: 4
}; };
let embeddingModelConfig = {
embedding_model: ''
};
let embeddingModel = ''; let embeddingModel = '';
const scanHandler = async () => { const scanHandler = async () => {
...@@ -66,9 +63,9 @@ ...@@ -66,9 +63,9 @@
updateEmbeddingModelLoading = true; updateEmbeddingModelLoading = true;
const res = await updateEmbeddingModel(localStorage.token, { const res = await updateEmbeddingModel(localStorage.token, {
embedding_model: embeddingModel embedding_model: embeddingModel
}).catch((error) => { }).catch(async (error) => {
toast.error(error); toast.error(error);
embeddingModel = embeddingModelConfig.embedding_model; embeddingModel = (await getEmbeddingModel(localStorage.token)).embedding_model;
return null; return null;
}); });
updateEmbeddingModelLoading = false; updateEmbeddingModelLoading = false;
...@@ -79,10 +76,6 @@ ...@@ -79,10 +76,6 @@
toast.success($i18n.t('Model {{embedding_model}} update complete!', res), { toast.success($i18n.t('Model {{embedding_model}} update complete!', res), {
duration: 1000 * 10 duration: 1000 * 10
}); });
} else {
toast.error($i18n.t('Model {{embedding_model}} update failed or not required!', res), {
duration: 1000 * 10
});
} }
} }
}; };
...@@ -108,8 +101,7 @@ ...@@ -108,8 +101,7 @@
chunkOverlap = res.chunk.chunk_overlap; chunkOverlap = res.chunk.chunk_overlap;
} }
embeddingModelConfig = await getEmbeddingModel(localStorage.token); embeddingModel = (await getEmbeddingModel(localStorage.token)).embedding_model;
embeddingModel = embeddingModelConfig.embedding_model;
querySettings = await getQuerySettings(localStorage.token); querySettings = await getQuerySettings(localStorage.token);
}); });
......
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