Fix button initialization

#2
by Xenova HF staff - opened
Files changed (1) hide show
  1. index.html +3 -3
index.html CHANGED
@@ -10,7 +10,9 @@
10
  env.allowLocalModels = false; // Skip check for models hosted locally
11
 
12
  const c = console;
13
-
 
 
14
  function progress_callback(x) {
15
  if (x.status === "done") {
16
  document.getElementById("status").textContent += `\ndone: ${x.file}`;
@@ -34,8 +36,6 @@
34
  }
35
 
36
  const translator = await pipeline('translation', 'Xenova/nllb-200-distilled-600M', { progress_callback });
37
-
38
- const button = document.getElementById("submit");
39
 
40
  button.addEventListener("click", async () => {
41
  button.value = "Computing...";
 
10
  env.allowLocalModels = false; // Skip check for models hosted locally
11
 
12
  const c = console;
13
+
14
+ const button = document.getElementById("submit");
15
+
16
  function progress_callback(x) {
17
  if (x.status === "done") {
18
  document.getElementById("status").textContent += `\ndone: ${x.file}`;
 
36
  }
37
 
38
  const translator = await pipeline('translation', 'Xenova/nllb-200-distilled-600M', { progress_callback });
 
 
39
 
40
  button.addEventListener("click", async () => {
41
  button.value = "Computing...";