()
| 70 | * Update the UI control states accordingly. |
| 71 | */ |
| 72 | export async function updateLocalModelStatus() { |
| 73 | const localModelStatus = document.getElementById('local-model-status'); |
| 74 | const localLoadButton = document.getElementById('load-local'); |
| 75 | const localRemoveButton = document.getElementById('remove-local'); |
| 76 | |
| 77 | const modelsInfo = await tf.io.listModels(); |
| 78 | if (LOCAL_MODEL_URL in modelsInfo) { |
| 79 | localModelStatus.textContent = 'Found locally-stored model saved at ' + |
| 80 | modelsInfo[LOCAL_MODEL_URL].dateSaved.toDateString(); |
| 81 | localLoadButton.disabled = false; |
| 82 | localRemoveButton.disabled = false; |
| 83 | } else { |
| 84 | localModelStatus.textContent = 'No locally-stored model is found.'; |
| 85 | localLoadButton.disabled = true; |
| 86 | localRemoveButton.disabled = true; |
| 87 | } |
| 88 | } |
nothing calls this directly
no outgoing calls
no test coverage detected