Add code to update Run button state on experiment update to avoid UI delay

This commit is contained in:
Tony Salomone
2025-04-03 17:00:39 -04:00
parent 9284b1f43b
commit dc6bb5e5ae

View File

@@ -32,7 +32,7 @@ export default function RunModelButton({
experimentInfo,
killWorker,
models,
mutate = () => {},
mutate = () => { },
}) {
const [jobId, setJobId] = useState(null);
const [showRunSettings, setShowRunSettings] = useState(false);
@@ -52,14 +52,13 @@ export default function RunModelButton({
);
}
// useEffect(() => {
// if (experimentInfo?.config?.inferenceParams) {
// setInferenceSettings(JSON.parse(experimentInfo?.config?.inferenceParams));
// }
// }, [experimentInfo]);
// Set a default inference Engine if there is none
useEffect(() => {
// Update experiment inference parameters so the Run button shows correctly
if (experimentInfo?.config?.inferenceParams) {
setInferenceSettings(JSON.parse(experimentInfo?.config?.inferenceParams));
}
// console.log('Searching for primary inference engine');
// console.log(inferenceSettings);
(async () => {
@@ -69,7 +68,7 @@ export default function RunModelButton({
experimentInfo?.id,
'loader', // type
'model_architectures:' +
experimentInfo?.config?.foundation_model_architecture //filter
experimentInfo?.config?.foundation_model_architecture //filter
)
);
const inferenceEnginesJSON = await inferenceEngines.json();