File size: 581 Bytes
58560a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

async function humanize() {
  const input = document.getElementById("inputText").value;
  const outputArea = document.getElementById("outputText");
  outputArea.value = "Processing...";

  try {
    const response = await fetch("/humanize", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ input: input })
    });

    const result = await response.json();
    outputArea.value = result[0]?.generated_text || "Error: Unexpected response.";
  } catch (err) {
    outputArea.value = "Request failed: " + err.message;
  }
}