add path contains space prompt and chore

This commit is contained in:
josc146
2023-06-02 23:35:33 +08:00
parent 2b10ccd507
commit 1036852924
4 changed files with 16 additions and 10 deletions

View File

@@ -835,9 +835,9 @@ export const Configs: FC = observer(() => {
</div>
} />
<ToolTipButton text={t('Convert')} desc={t('Convert model with these configs')} onClick={async () => {
if(commonStore.platform=="darwin"){
toast(t("MacOS is not supported yet, please convert manually."), { type: 'info' })
return
if (commonStore.platform == 'darwin') {
toast(t('MacOS is not supported yet, please convert manually.'), { type: 'info' });
return;
}
const modelPath = `${commonStore.settings.customModelsPath}/${selectedConfig.modelParameters.modelName}`;
@@ -849,7 +849,11 @@ export const Configs: FC = observer(() => {
toast(`${t('Convert Success')} - ${newModelPath}`, { type: 'success' });
refreshLocalModels({ models: commonStore.modelSourceList }, false);
}).catch(e => {
toast(`${t('Convert Failed')} - ${e.message || e}`, { type: 'error' });
const errMsg = e.message || e;
if (errMsg.includes('path contains space'))
toast(`${t('Convert Failed')} - ${t('Path Cannot Contain Space')}`, { type: 'error' });
else
toast(`${t('Convert Failed')} - ${e.message || e}`, { type: 'error' });
});
setTimeout(WindowShow, 1000);
} else {

View File

@@ -129,7 +129,7 @@ export const Settings: FC = observer(() => {
}} />
} />
}
<Labeled label={t('Custom Python Path')}
<Labeled label={t('Custom Python Path')} // if set, will not use precompiled cuda kernel
content={
<Input className="grow" placeholder="./py310/python" value={commonStore.settings.customPythonPath}
onChange={(e, data) => {