batmac commited on
Commit
f3d260f
·
verified ·
1 Parent(s): 320051b

Enable Analyze before announcing readiness

Browse files
Files changed (1) hide show
  1. boot.js +3 -1
boot.js CHANGED
@@ -21,12 +21,14 @@ try {
21
  }
22
  },
23
  });
24
- status.textContent = `Model ready (${dtype} on ${device}). `;
25
  initializeUi({
26
  analyze: createAnalyze({ scoreBatch, countTokens, device, dtype }),
27
  modelRepo: MODEL_REPO,
28
  });
 
 
29
  button.disabled = false;
 
30
  } catch (exc) {
31
  status.textContent = '';
32
  error.textContent = `Could not load the model: ${exc.message}`;
 
21
  }
22
  },
23
  });
 
24
  initializeUi({
25
  analyze: createAnalyze({ scoreBatch, countTokens, device, dtype }),
26
  modelRepo: MODEL_REPO,
27
  });
28
+ // Enable before announcing readiness: a click on a disabled button is dropped
29
+ // silently, so "ready" must never appear while Analyze is still dead.
30
  button.disabled = false;
31
+ status.textContent = `Model ready (${dtype} on ${device}). `;
32
  } catch (exc) {
33
  status.textContent = '';
34
  error.textContent = `Could not load the model: ${exc.message}`;