humanizer4.0 / script.js
khaliqabdull's picture
Upload 5 files
58560a4 verified
raw
history blame contribute delete
581 Bytes
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;
}
}