Update static/script.js
Browse files- static/script.js +11 -11
static/script.js
CHANGED
@@ -4,7 +4,7 @@ const translateText = async (text) => {
|
|
4 |
const inferResponse = await fetch(`infer_t5?input=${text}`);
|
5 |
const inferJson = await inferResponse.json();
|
6 |
|
7 |
-
return inferJson
|
8 |
};
|
9 |
|
10 |
textGenForm.addEventListener('submit', async (event) => {
|
@@ -12,18 +12,18 @@ textGenForm.addEventListener('submit', async (event) => {
|
|
12 |
|
13 |
const textGenInput = document.getElementById('text-gen-input');
|
14 |
const textGenParagraph = document.querySelector('.text-gen-output');
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
|
20 |
try {
|
21 |
-
var text_out
|
22 |
-
textGenParagraph.textContent = size_str;
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
} catch (err) {
|
28 |
console.error(err);
|
29 |
}
|
|
|
4 |
const inferResponse = await fetch(`infer_t5?input=${text}`);
|
5 |
const inferJson = await inferResponse.json();
|
6 |
|
7 |
+
return inferJson;
|
8 |
};
|
9 |
|
10 |
textGenForm.addEventListener('submit', async (event) => {
|
|
|
12 |
|
13 |
const textGenInput = document.getElementById('text-gen-input');
|
14 |
const textGenParagraph = document.querySelector('.text-gen-output');
|
15 |
+
const textGenParagraph_2 = document.querySelector('.text-gen-output_2');
|
16 |
+
const textGenParagraph_3 = document.querySelector('.text-gen-output_3');
|
17 |
+
const textGenParagraph_4 = document.querySelector('.text-gen-output_4');
|
18 |
+
const textGenParagraph_5 = document.querySelector('.text-gen-output_5');
|
19 |
|
20 |
try {
|
21 |
+
var text_out = await translateText(textGenInput.value);
|
22 |
+
textGenParagraph.textContent = text_out.size_str;
|
23 |
+
textGenParagraph_2.textContent = text_out.size_4;
|
24 |
+
textGenParagraph_3.textContent = text_out.cancer;
|
25 |
+
textGenParagraph_4.textContent = text_out.transfer;
|
26 |
+
textGenParagraph_5.textContent = text_out.ly_transfer;
|
27 |
} catch (err) {
|
28 |
console.error(err);
|
29 |
}
|