Songyou commited on
Commit
01ce2cc
·
verified ·
1 Parent(s): b47ecb2

Update static/index.html

Browse files
Files changed (1) hide show
  1. static/index.html +24 -32
static/index.html CHANGED
@@ -1,32 +1,24 @@
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>FastAPI Example</title>
7
- </head>
8
- <body>
9
- <h1>FastAPI Input Example</h1>
10
- <input type="text" id="user_input" placeholder="Enter something...">
11
- <button onclick="submitInput()">Submit</button>
12
- <p id="response"></p>
13
-
14
- <script>
15
- function submitInput() {
16
- const input = document.getElementById("user_input").value;
17
- fetch("http://localhost:8000/submit", {
18
- method: "POST",
19
- headers: {
20
- "Content-Type": "application/json"
21
- },
22
- body: JSON.stringify({ user_input: input })
23
- })
24
- .then(response => response.json())
25
- .then(data => {
26
- document.getElementById("response").textContent = "Response: " + data.message;
27
- })
28
- .catch(error => console.error("Error:", error));
29
- }
30
- </script>
31
- </body>
32
- </html>
 
1
+ <main>
2
+ <section id="text-gen">
3
+ <h2>Text generation using Flan T5</h2>
4
+ <p>
5
+ Model:
6
+ <a
7
+ href="https://huggingface.co/google/flan-t5-small"
8
+ rel="noreferrer"
9
+ target="_blank"
10
+ >google/flan-t5-small
11
+ </a>
12
+ </p>
13
+ <form class="text-gen-form">
14
+ <label for="text-gen-input">Text prompt</label>
15
+ <input
16
+ id="text-gen-input"
17
+ type="text"
18
+ value="German: There are many ducks"
19
+ />
20
+ <button id="text-gen-submit">Submit</button>
21
+ <p class="text-gen-output"></p>
22
+ </form>
23
+ </section>
24
+ </main>