Merge pull request #353 from transformerlab/add/enhance-model-provenance

Change message for Provenance not found
This commit is contained in:
Deep Gandhi
2025-04-08 20:14:29 -07:00
committed by GitHub
3 changed files with 20 additions and 8 deletions

View File

@@ -41,14 +41,21 @@ function formatTemplateConfig(script_parameters): ReactElement {
const tasksArray = JSON.parse(script_parameters.tasks);
if (Array.isArray(tasksArray)) {
if (predefined_tasks && predefined_tasks !== '') {
// Check if tasks array is empty
if (tasksArray.length === 0) {
// If tasks array is empty, return only the predefined tasks
return predefined_tasks;
}
// If tasks array is not empty, join the tasks with the predefined tasks
// and return the result
return (
tasksArray.map((task) => task.name).join(', ') + ',' + predefined_tasks
tasksArray.map((task) => task.name).join(', ') +
',' +
predefined_tasks
);
}
// If predefined_tasks is empty, just return the tasks
return (
tasksArray.map((task) => task.name).join(', ')
);
return tasksArray.map((task) => task.name).join(', ');
}
} catch (error) {
// Invalid JSON; fall back to the original value

View File

@@ -451,7 +451,7 @@ export default function CurrentFoundationInfo({
) : currentProvenanceError ? (
<Typography>Error loading provenance data</Typography>
) : (
<Typography>Loading provenance data...</Typography>
<Typography>No Provenance Data Found</Typography>
)}
</Box>
)}

View File

@@ -147,7 +147,6 @@ export default function TrainingModalLoRA({
outputs: outputs,
type: 'TRAIN',
};
console.log(configBody);
const response = await fetch(chatAPI.Endpoints.Tasks.NewTask(), {
method: 'PUT',
headers: {
@@ -320,13 +319,19 @@ export default function TrainingModalLoRA({
const templateDataInputs = JSON.parse(templateData.inputs);
const templateDataOutputs = JSON.parse(templateData.outputs);
for (const key in templateDataInputs) {
if (key in formJson && templateDataInputs[key] != formJson[key]) {
if (
key in formJson &&
templateDataInputs[key] != formJson[key]
) {
templateDataInputs[key] = formJson[key];
}
}
// For all keys in templateData.outputs that are in formJson, set the value from formJson
for (const key in templateDataOutputs) {
if (key in formJson && templateDataOutputs[key] != formJson[key]) {
if (
key in formJson &&
templateDataOutputs[key] != formJson[key]
) {
templateDataOutputs[key] = formJson[key];
}
}