Update translation.html
Browse files- translation.html +2 -6
translation.html
CHANGED
|
@@ -79,7 +79,7 @@
|
|
| 79 |
const token = document.getElementById("hf-token").value;
|
| 80 |
console.log("TOKEN: ", token);
|
| 81 |
hf = new HfInference();
|
| 82 |
-
console.log(hf);
|
| 83 |
}
|
| 84 |
|
| 85 |
async function translateText() {
|
|
@@ -90,7 +90,7 @@
|
|
| 90 |
}
|
| 91 |
|
| 92 |
const textFieldValue = document.getElementById("translationText2").value.trim();
|
| 93 |
-
|
| 94 |
try {
|
| 95 |
let result = await hf.translation({
|
| 96 |
model: 't5-base',
|
|
@@ -99,10 +99,6 @@
|
|
| 99 |
document.getElementById("outputArea2").innerText = JSON.stringify(result, null, 2);
|
| 100 |
} catch (error) {
|
| 101 |
console.error("Error during translation:", error);
|
| 102 |
-
if (error.response && error.response.json) {
|
| 103 |
-
error.response.json().then(json => {
|
| 104 |
-
console.error("Error details:", json);
|
| 105 |
-
});
|
| 106 |
}
|
| 107 |
}
|
| 108 |
}
|
|
|
|
| 79 |
const token = document.getElementById("hf-token").value;
|
| 80 |
console.log("TOKEN: ", token);
|
| 81 |
hf = new HfInference();
|
| 82 |
+
//console.log(hf);
|
| 83 |
}
|
| 84 |
|
| 85 |
async function translateText() {
|
|
|
|
| 90 |
}
|
| 91 |
|
| 92 |
const textFieldValue = document.getElementById("translationText2").value.trim();
|
| 93 |
+
console.log(textFieldValue)
|
| 94 |
try {
|
| 95 |
let result = await hf.translation({
|
| 96 |
model: 't5-base',
|
|
|
|
| 99 |
document.getElementById("outputArea2").innerText = JSON.stringify(result, null, 2);
|
| 100 |
} catch (error) {
|
| 101 |
console.error("Error during translation:", error);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
}
|
| 103 |
}
|
| 104 |
}
|