-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
46 lines (27 loc) · 1.03 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
42
43
44
45
46
<html>
<title> Malayalam Movie Idea Generation powered by Gradio API</title>
<body>
<h1>Text Generation powered by Gradio API 🤗 </h1>
<textarea rows='14' id="input_text" placeholder="Enter your text here...."></textarea>
<button class="get_values" onclick="startUpdate(event)"> GET MOVIE IDEA</button>
<textarea rows='14' id="result" placeholder="Wait for the result"></textarea>
<script>
function startUpdate(e) {
updateTextArea();
}
function updateTextArea() {
let url = "https://hf.space/embed/bananabot/ThisMollywoodMovieDoesNotExist.com/+/api/predict/"; // url
var text = document.getElementById("input_text").value;
//console.log(text);
fetch(url, { method: "POST", body: JSON.stringify({"data": [text]
}), headers: { "Content-Type": "application/json" } })
.then(response => response.json())
.then(data => {
let textArea = document.getElementById("result");
// parsing the JSON value to string
textArea.value = JSON.stringify(data);
})
}
</script>
</body>
</html>