MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / updateLocalModelStatus

Function updateLocalModelStatus

iris/loader.js:72–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 * Update the UI control states accordingly.
71 */
72export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected