fix duplicate switchModel()

This commit is contained in:
josc146 2023-05-23 22:27:25 +08:00
parent ec7d50431e
commit 5c0513a3cc

View File

@ -119,13 +119,13 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
readRoot() readRoot()
.then(async r => { .then(async r => {
if (r.ok && !loading) { if (r.ok && !loading) {
loading = true;
clearInterval(intervalId); clearInterval(intervalId);
await getStatus().then(status => { await getStatus().then(status => {
if (status) if (status)
commonStore.setStatus(status); commonStore.setStatus(status);
}); });
commonStore.setStatus({ modelStatus: ModelStatus.Loading }); commonStore.setStatus({ modelStatus: ModelStatus.Loading });
loading = true;
toast(t('Loading Model'), { type: 'info' }); toast(t('Loading Model'), { type: 'info' });
updateConfig({ updateConfig({
max_tokens: modelConfig.apiParameters.maxResponseToken, max_tokens: modelConfig.apiParameters.maxResponseToken,