aamos commited on
Commit
6f55d28
·
verified ·
1 Parent(s): 4363319

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +36 -18
index.html CHANGED
@@ -1,19 +1,37 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+