boazchung commited on
Commit
a9d79f0
1 Parent(s): 193a47d

Update translation.html

Browse files
Files changed (1) hide show
  1. translation.html +3 -10
translation.html CHANGED
@@ -4,7 +4,7 @@
4
  <head>
5
  <meta charset="UTF-8">
6
  <title>Translation - huggingface.js</title>
7
-
8
  <script type="module">
9
  // Import the library
10
  //import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.5.4';
@@ -12,9 +12,8 @@
12
  // Make it available globally
13
  //window.pipeline = pipeline;
14
  </script>
15
-
16
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet">
17
-
18
  <link rel="stylesheet" href="css/styles.css">
19
  </head>
20
 
@@ -67,14 +66,10 @@
67
  <script type="module">
68
  import { HfInference } from 'https://cdn.jsdelivr.net/npm/@huggingface/inference@2.6.4/+esm';
69
 
70
- let translator;
71
- let translator2;
72
-
73
  // Initialize the sentiment analysis model
74
  async function initializeModel() {
75
  const token = document.getElementById('hf-token').value;
76
  const hf = new HfInference(token);
77
-
78
  }
79
 
80
  async function translateText() {
@@ -84,9 +79,7 @@
84
  model: 't5-base',
85
  inputs: textFieldValue,
86
  document.getElementById("outputArea2").innerText = JSON.stringify(result, null, 2);
87
- });
88
-
89
-
90
  }
91
 
92
 
 
4
  <head>
5
  <meta charset="UTF-8">
6
  <title>Translation - huggingface.js</title>
7
+ <!--
8
  <script type="module">
9
  // Import the library
10
  //import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.5.4';
 
12
  // Make it available globally
13
  //window.pipeline = pipeline;
14
  </script>
15
+ -->
16
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet">
 
17
  <link rel="stylesheet" href="css/styles.css">
18
  </head>
19
 
 
66
  <script type="module">
67
  import { HfInference } from 'https://cdn.jsdelivr.net/npm/@huggingface/inference@2.6.4/+esm';
68
 
 
 
 
69
  // Initialize the sentiment analysis model
70
  async function initializeModel() {
71
  const token = document.getElementById('hf-token').value;
72
  const hf = new HfInference(token);
 
73
  }
74
 
75
  async function translateText() {
 
79
  model: 't5-base',
80
  inputs: textFieldValue,
81
  document.getElementById("outputArea2").innerText = JSON.stringify(result, null, 2);
82
+ });
 
 
83
  }
84
 
85