mirror of
https://github.com/transformerlab/transformerlab-app.git
synced 2025-04-14 07:48:20 +03:00
Merge pull request #353 from transformerlab/add/enhance-model-provenance
Change message for Provenance not found
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user