gmerrill commited on
Commit
a2fd098
·
1 Parent(s): 71a4bbf
Files changed (1) hide show
  1. static/script.js +3 -4
static/script.js CHANGED
@@ -1,7 +1,7 @@
1
  const textGenForm = document.querySelector('.text-gen-form');
2
 
3
  const translateText = async (text) => {
4
- const inferResponse = await fetch(
5
  `query_gorilla`,
6
  {
7
  method: 'POST',
@@ -11,9 +11,8 @@ const translateText = async (text) => {
11
  body: text
12
  }
13
  );
14
- const inferJson = await inferResponse.json();
15
-
16
- return JSON.stringify(inferJson);
17
  };
18
 
19
  textGenForm.addEventListener('submit', async (event) => {
 
1
  const textGenForm = document.querySelector('.text-gen-form');
2
 
3
  const translateText = async (text) => {
4
+ const response = await fetch(
5
  `query_gorilla`,
6
  {
7
  method: 'POST',
 
11
  body: text
12
  }
13
  );
14
+ const responseJSON = await response.json();
15
+ return JSON.stringify(responseJSON);
 
16
  };
17
 
18
  textGenForm.addEventListener('submit', async (event) => {