improve training data path compatibility
This commit is contained in:
parent
ee63dc25f4
commit
0edec68376
@ -281,7 +281,9 @@ const LoraFinetune: FC = observer(() => {
|
|||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const convertedDataPath = `./finetune/json2binidx_tool/data/${dataParams.dataPath.split(/[\/\\]/).pop()!.split('.')[0]}_text_document`;
|
const convertedDataPath = './finetune/json2binidx_tool/data/' +
|
||||||
|
dataParams.dataPath.replace(/[\/\\]$/, '').split(/[\/\\]/).pop()!.split('.')[0] +
|
||||||
|
'_text_document';
|
||||||
if (!await FileExists(convertedDataPath + '.idx')) {
|
if (!await FileExists(convertedDataPath + '.idx')) {
|
||||||
toast(t('Please convert data first.'), { type: 'error' });
|
toast(t('Please convert data first.'), { type: 'error' });
|
||||||
return;
|
return;
|
||||||
@ -432,7 +434,10 @@ const LoraFinetune: FC = observer(() => {
|
|||||||
return;
|
return;
|
||||||
const outputPrefix = './finetune/json2binidx_tool/data/' +
|
const outputPrefix = './finetune/json2binidx_tool/data/' +
|
||||||
dataParams.dataPath.replace(/[\/\\]$/, '').split(/[\/\\]/).pop()!.split('.')[0];
|
dataParams.dataPath.replace(/[\/\\]$/, '').split(/[\/\\]/).pop()!.split('.')[0];
|
||||||
ConvertData(commonStore.settings.customPythonPath, dataParams.dataPath, outputPrefix, dataParams.vocabPath).then(async () => {
|
ConvertData(commonStore.settings.customPythonPath,
|
||||||
|
dataParams.dataPath.replaceAll('\\', '/'),
|
||||||
|
outputPrefix,
|
||||||
|
dataParams.vocabPath).then(async () => {
|
||||||
if (!await FileExists(outputPrefix + '_text_document.idx')) {
|
if (!await FileExists(outputPrefix + '_text_document.idx')) {
|
||||||
toast(t('Failed to convert data') + ' - ' + await GetPyError(), { type: 'error' });
|
toast(t('Failed to convert data') + ' - ' + await GetPyError(), { type: 'error' });
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user