forked from akash-network/awesome-akash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
41 lines (37 loc) · 1.09 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<title>Falcon-7b Interface</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<h1>Falcon-7b Interface</h1>
<label for="input-text">Enter your text:</label>
<input type="text" id="input-text">
<button onclick="generateText()">Generate</button>
<h2>Generated Texts:</h2>
<div id="generated-texts"></div>
<script>
function generateText() {
var inputText = $("#input-text").val();
$.ajax({
url: "/generate",
type: "POST",
data: JSON.stringify({ "text": inputText }),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
displayGeneratedTexts(data.generated_texts);
}
});
}
function displayGeneratedTexts(texts) {
var generatedTextsContainer = $("#generated-texts");
generatedTextsContainer.empty();
texts.forEach(function(text, index) {
generatedTextsContainer.append("<p>Response " + (index + 1) + ": " + text + "</p>");
});
}
</script>
</body>
</html>