checkpoint info in dropdowns
This commit is contained in:
@@ -127,20 +127,36 @@
|
||||
placeholder.textContent = 'Select a model...';
|
||||
modelSelect.appendChild(placeholder);
|
||||
|
||||
// Add model options with load status
|
||||
// Add model options with load status and checkpoint info
|
||||
data.models.forEach((model, index) => {
|
||||
console.log(` Model ${index}:`, model, 'Type:', typeof model);
|
||||
|
||||
// Ensure model is an object with name property
|
||||
const modelName = (model && typeof model === 'object' && model.name) ? model.name : String(model);
|
||||
const isLoaded = (model && typeof model === 'object' && 'loaded' in model) ? model.loaded : false;
|
||||
const checkpoint = (model && typeof model === 'object' && model.checkpoint) ? model.checkpoint : null;
|
||||
|
||||
console.log(` → Name: "${modelName}", Loaded: ${isLoaded}`);
|
||||
console.log(` → Name: "${modelName}", Loaded: ${isLoaded}`, checkpoint ? `Checkpoint: epoch ${checkpoint.epoch}, loss ${checkpoint.loss.toFixed(4)}` : '');
|
||||
|
||||
const option = document.createElement('option');
|
||||
option.value = modelName;
|
||||
option.textContent = modelName + (isLoaded ? ' ✓' : ' (not loaded)');
|
||||
|
||||
// Build option text with checkpoint info
|
||||
let optionText = modelName;
|
||||
if (isLoaded) {
|
||||
optionText += ' ✓';
|
||||
if (checkpoint) {
|
||||
optionText += ` (E${checkpoint.epoch}, L:${checkpoint.loss.toFixed(3)}, A:${(checkpoint.accuracy * 100).toFixed(1)}%)`;
|
||||
}
|
||||
} else {
|
||||
optionText += ' (not loaded)';
|
||||
}
|
||||
|
||||
option.textContent = optionText;
|
||||
option.dataset.loaded = isLoaded;
|
||||
if (checkpoint) {
|
||||
option.dataset.checkpoint = JSON.stringify(checkpoint);
|
||||
}
|
||||
modelSelect.appendChild(option);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user