Repository navigation
Expand file tree
/
Copy pathLLM_Answer2.html
More file actions
221 lines (187 loc) · 5.1 KB
/
Copy pathLLM_Answer2.html
File metadata and controls
221 lines (187 loc) · 5.1 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="./static/styleLLM.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LLM Answer</title>
<!-- Additional meta tags, CSS links, or JavaScript links can go here -->
<!-- Includi jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Includi autosize.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/autosize.js/4.0.2/autosize.min.js"></script>
<style>
* {
outline:none;
border:none;
margin:0px;
padding:0px;
font-family:Courier, monospace;
}
body {
background:#ffffff;
}
#paper {
color:#FFF;
font-size:20px;
display: flex;
width: 100%;
}
#text {
width: 90%;
overflow:hidden;
background-color:#FFF;
color:#222;
font-family:Courier, monospace;
font-weight:normal;
font-size:24px;
resize:none;
line-height:40px;
padding-left:100px;
padding-right:100px;
padding-top:45px;
padding-bottom:34px;
background-image:url(./static/Images/lines.png) , url(https://static.tumblr.com/maopbtg/nBUmgtogx/paper.png);
/*background-repeat:repeat-y, repeat;*/
-webkit-border-radius:12px;
border-radius:12px;
-webkit-box-shadow: 0px 2px 8px #727272;
box-shadow: 0px 2px 8px #727272;
border-top:1px solid #FFF;
border-bottom:1px solid #FFF;
}
#title {
background-color:transparent;
border-bottom:3px solid #FFF;
color:#FFF;
font-size:20px;
font-family:Courier, monospace;
height:28px;
font-weight:bold;
width:220px;
}
#button {
cursor:pointer;
margin-top:20px;
float:right;
height:40px;
padding-left:24px;
padding-right:24px;
font-family:Arial, Helvetica, sans-serif;
font-weight:bold;
font-size:20px;
color:#FFF;
text-shadow: 0px -1px 0px #000000;
-webkit-border-radius:8px;
border-radius:8px;
border-top:1px solid #FFF;
-webkit-box-shadow: 0px 2px 14px #000;
box-shadow: 0px 2px 14px #000;
background-color: #62add6;
background-image:url(https://static.tumblr.com/maopbtg/ZHLmgtok7/button.png);
background-repeat:repeat-x;
}
#button:active {
zoom: 1;
filter: alpha(opacity=80);
opacity: 0.8;
}
#button:focus {
zoom: 1;
filter: alpha(opacity=80);
opacity: 0.8;
}
#wrapper {
width:90%;
height:auto;
margin-left:auto;
margin-right:auto;
margin-top:24px;
margin-bottom:100px;
}
</style>
</head>
<body>
<div class="header">
<!--Content before waves-->
<div class="inner-header flex">
<!--Just the logo.. Don't mind this-->
<img src="./static/Images/logo_dais_bianco.png" onclick="location.reload();" class="logo">
</div>
<!--Waves Container-->
<div>
<svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
<defs>
<path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
</defs>
<g class="parallax">
<use xlink:href="#gentle-wave" x="48" y="0" fill="rgba(255,255,255,0.7" />
<use xlink:href="#gentle-wave" x="48" y="3" fill="rgba(255,255,255,0.5)" />
<use xlink:href="#gentle-wave" x="48" y="5" fill="rgba(255,255,255,0.3)" />
<use xlink:href="#gentle-wave" x="48" y="7" fill="#fff" />
</g>
</svg>
</div>
<!--Waves end-->
</div>
<!--Header ends-->
<!--Content starts-->
<!--Content ends-->
<div id="wrapper">
<form id="paper" method="get" action="">
<textarea placeholder="LLM Answer...." id="text" name="text" spellcheck="false" rows="4" style="overflow: hidden; word-wrap: break-word; resize: none; height: 160px; ">
</textarea>
<br>
</form>
</div>
<script>
$(document).ready(function(){
$('#title').focus();
autosize($('#text'));
$('#text').html('I am processing the explanation. Be patient for a few seconds...');
});
function getParams ()
{
var result = {};
var tmp = [];
location.search
.substr (1)
.split ("&")
.forEach (function (item)
{
tmp = item.split ("=");
result [tmp[0]] = decodeURIComponent (tmp[1]);
});
return result;
}
location.getParams = getParams;
var prompt_to_ask = location.getParams()["prompt"];
//console.log (location.getParams());
console.log (prompt_to_ask);
$.ajax({
type:"GET",
dataType:"text",
contentType: "application/text",
xhrFields: { withCredentials: false },
crossDomain: true,
// async: false, // async dovrebbe andare bene in quanto è una componente di output
data: {"prompt": prompt_to_ask},
url:"http://127.0.0.1:5000/askllm",
})
.done(function(response){
getjson = $.parseJSON(response)
console.log("Response http://127.0.0.1:5000/askllm: ",response)
console.log("Response http://127.0.0.1:5000/askllm getjson: ",getjson)
//alert("Dataset Loaded Successfully!");
$('#text').html(getjson['LLMAnswer']);
})
.fail(function(xhr, textStatus, errorThrown){
console.log("ERROR http://127.0.0.1:5000/askllm: ",xhr.responseText)
//alert("Dataset upload error! "+errorThrown);
return xhr.responseText;
}).then(function(value){
})
</script>
</body>
</html>