Update index.html
Browse files- index.html +36 -18
index.html
CHANGED
@@ -1,19 +1,37 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>LSTM Text Generation</title>
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
<h1>LSTM Text Generation</h1>
|
10 |
+
<form id="text-form">
|
11 |
+
<label for="user-input">Enter your input:</label><br>
|
12 |
+
<textarea id="user-input" name="user-input" rows="4" cols="50"></textarea><br>
|
13 |
+
<button type="submit">Generate Text</button>
|
14 |
+
</form>
|
15 |
+
<div id="output"></div>
|
16 |
+
|
17 |
+
<script>
|
18 |
+
document.getElementById("text-form").addEventListener("submit", function(event) {
|
19 |
+
event.preventDefault();
|
20 |
+
var userInput = document.getElementById("user-input").value;
|
21 |
+
|
22 |
+
fetch("/generate", {
|
23 |
+
method: "POST",
|
24 |
+
headers: {
|
25 |
+
"Content-Type": "application/json"
|
26 |
+
},
|
27 |
+
body: JSON.stringify({ input_text: userInput })
|
28 |
+
})
|
29 |
+
.then(response => response.json())
|
30 |
+
.then(data => {
|
31 |
+
document.getElementById("output").innerText = data.generated_text;
|
32 |
+
});
|
33 |
+
});
|
34 |
+
</script>
|
35 |
+
</body>
|
36 |
</html>
|
37 |
+
|