diff --git a/frontend/src/_locales/zh-hans/main.json b/frontend/src/_locales/zh-hans/main.json index 5648875..30a176d 100644 --- a/frontend/src/_locales/zh-hans/main.json +++ b/frontend/src/_locales/zh-hans/main.json @@ -137,7 +137,6 @@ "Custom Models Path": "自定义模型路径", "Microsoft Visual C++ Redistributable is not installed, would you like to download it?": "微软VC++组件未安装, 是否下载?", "File Path Cannot Contain Space": "文件路径不能包含空格", - "Failed to switch model, please try starting the program with administrator privileges or increasing your virtual memory.": "切换模型失败, 请尝试以管理员权限启动程序, 或增加你的虚拟内存", "Current Strategy": "当前Strategy", "MacOS is not yet supported for performing this operation, please do it manually.": "MacOS尚未支持此操作, 请手动执行", "Linux is not yet supported for performing this operation, please do it manually.": "Linux尚未支持此操作, 请手动执行", diff --git a/frontend/src/components/RunButton.tsx b/frontend/src/components/RunButton.tsx index eba9776..fbf4c43 100644 --- a/frontend/src/components/RunButton.tsx +++ b/frontend/src/components/RunButton.tsx @@ -196,7 +196,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean model: modelPath, strategy: getStrategy(modelConfig), customCuda: customCudaFile !== '' - }).then((r) => { + }).then(async (r) => { if (r.ok) { commonStore.setStatus({ status: ModelStatus.Working }); toastWithButton(t('Startup Completed'), t('Chat'), () => { @@ -206,14 +206,11 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean toast(t('Loading Model'), { type: 'info' }); } else { commonStore.setStatus({ status: ModelStatus.Offline }); - toast(t('Failed to switch model'), { type: 'error' }); + toast(t('Failed to switch model') + ' - ' + await r.text(), { type: 'error' }); } - }).catch(() => { + }).catch((e) => { commonStore.setStatus({ status: ModelStatus.Offline }); - if (commonStore.platform === 'windows') - toast(t('Failed to switch model, please try starting the program with administrator privileges or increasing your virtual memory.'), { type: 'error' }); - else - toast(t('Failed to switch model'), { type: 'error' }); + toast(t('Failed to switch model') + ' - ' + e.message || e, { type: 'error' }); }); } }).catch(() => {