improve upgrade process

This commit is contained in:
josc146
2023-05-24 23:05:19 +08:00
parent 9f080b63e0
commit 5192e31bac
3 changed files with 20 additions and 5 deletions

View File

@@ -144,8 +144,12 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
if (!exist) CopyFile('./backend-python/wkv_cuda_utils/wkv_cuda_model.py', './py310/Lib/site-packages/rwkv/model.py');
});
await CopyFile(customCudaFile, './py310/Lib/site-packages/rwkv/wkv_cuda.pyd').catch(() => {
customCudaFile = '';
toast(t('Failed to copy custom cuda file'), { type: 'error' });
FileExists('./py310/Lib/site-packages/rwkv/wkv_cuda.pyd').then((exist) => {
if (!exist) {
customCudaFile = '';
toast(t('Failed to copy custom cuda file'), { type: 'error' });
}
});
});
} else
toast(t('Supported custom cuda file not found'), { type: 'warning' });