-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
284 lines (241 loc) · 12.2 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
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<!DOCTYPE html>
<html>
<head>
<title>Qdrant Frontend</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
</head>
<style>
.col {
margin-bottom: 10px;
}
#loading {
display: inline-block;
width: 1rem;
height: 1rem;
border: 3px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s ease-in-out infinite;
-webkit-animation: spin 1s ease-in-out infinite;
padding: 10px;
margin-right: 10px;
}
#submit_button {
display: inline-flex;
}
#table-wrapper {
padding: 20px;
max-height: 500px;
overflow: auto;
}
#dimensionalityReduction {
margin-right: 20px;
}
#plot-container {
max-height: 700px;
height: 0;
}
#deckgl {
position: relative !important;
}
#tooltip {
position: absolute;
opacity: 1000;
font-size: 20px;
border-radius: var(--bs-border-radius);
background-color: #f5f8ffcf;
outline: 2px solid #dfebff;
padding: 8px;
max-width: 500px;
}
@keyframes spin {
to {
-webkit-transform: rotate(360deg);
}
}
@-webkit-keyframes spin {
to {
-webkit-transform: rotate(360deg);
}
}
</style>
<body>
<br />
<div class="text-center">
<h3>Qdrant Frontend (<a href="https://github.com/do-me/qdrant-frontend" target="_blank">GitHub</a>)</h3>
<h5>A universal frontend for <a href="https://qdrant.tech/" target="_blank">Qdrant</a> built with <a
href="https://xenova.github.io/transformers.js/" target="_blank">transformers.js</a> to allow<br> for
quick semantic search without the need for server-side inferencing.</h5>
<p>Download a Qdrant snapshot about SDGs <a href="https://github.com/do-me/SDG-Analyzer/blob/main/SDG_Qdrant.snapshot" target="_blank">here</a> and give it a try!</p>
</div>
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-8 text-center">
<h5 class="text-start">Settings</h5>
<div class="col">
<div class="form-floating">
<input id="QdrantURL" class="form-control w-100" type="text"
value="http://localhost:6333/collections/<collection>" />
<label for="QdrantURL">Qdrant Server URL</label>
</div>
</div>
<div class="col">
<div class="row">
<div class="col-md-10"> <!-- Adjusted width for HFModel -->
<div class="form-floating">
<input id="HFModel" class="form-control w-100 mb-2" type="text"
value="Xenova/bge-base-en-v1.5" />
<label for="HFModel">Model</label>
</div>
</div>
<div class="col-md-2 d-flex flex-column align-items-center justify-content-center">
<label class="form-check-label" for="quantizedToggle">Quantized</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="quantizedToggle" checked>
</div>
</div>
</div>
</div>
<div class="col">
<div class="form-floating">
<input id="QdrantLimit" class="form-control w-100" type="number" min="1" value="10" />
<label for="QdrantLimit"># Results Limit</label>
</div>
</div>
<h5 class="text-start">Weighted Queries</h5>
<div id="queryRowsContainer">
<div class="col row queryContainer" id="initialQueryContainer">
<div class="col-md-8">
<div class="form-floating">
<input id="inputText0" class="form-control w-100 inputText" type="text"
value="Climate Change" />
<label for="inputText0">Query</label>
</div>
</div>
<div class="col-md-2">
<div class="form-floating">
<input id="weight0" class="queryWeight form-control" type="number" step="0.1" value="1"
min="0" />
<label for="weight0">Weight</label>
</div>
</div>
<div class="col-md-1 d-flex flex-column align-items-center justify-content-center">
<label class="form-check-label" for="activeToggle0">Active</label>
<div class="form-check form-switch">
<input class="form-check-input activeToggle" type="checkbox" id="activeToggle0" checked>
</div>
</div>
<div class="col-md-1 d-flex flex-column align-items-center justify-content-center">
<button class="btn btn-light queryButton" id="queryButton0" type="button" title="Add query">
<!-- SVG Code Here -->
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" class="feather feather-plus">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-floating">
<button type="submit" id="submit_button" class="btn btn-primary mb-2">
<div id="loading" style="display: none;"></div>
<div id="submit_button_text">Load model</div>
</button>
</div>
</div>
<div class="col">
<button id="copyURLButton" class="btn btn-light mb-2">Copy URL (Settings)</button>
</div>
<div class="col">
<div class="dropdown">
<button class="btn btn-light dropdown-toggle mb-2" type="button" id="exportDropdown"
data-bs-toggle="dropdown" aria-expanded="false" disabled>
Export Data
</button>
<ul class="dropdown-menu" aria-labelledby="exportDropdown">
<li><button id="download_xlsx" class="dropdown-item" type="button">XLSX</button></li>
<li><button id="download_csv" class="dropdown-item" type="button">CSV</button></li>
<li><button id="download_json" class="dropdown-item" type="button">JSON</button></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="table-wrapper">
<div id="quickFilter" class="example-header" style="display: none;">
<span>Quick Filter:</span>
<input type="text" id="filter-text-box" placeholder="Filter...">
</div>
<div id="myGrid" class="ag-theme-quartz">
</div>
</div>
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-8 text-center">
<div>
<hr />
<h4>Dimensionality Reduction</h4>
<p>Using a fast wasm implementation of Barnes-Hut tSNE (<a
href="https://github.com/Lv-291/wasm-bhtsne" target="_blank">wasm-bhtSNE</a>).</p>
<div class="d-flex flex-row">
<button type="button" class="btn btn-md btn-primary mb-2 nav-button"
id="dimensionalityReduction">🌌 Dim-Reduction</button>
<div class="row">
<div class="col-md-3">
<div class="form-floating mb-2">
<input id="dimReductionIterations" class="form-control w-100" type="number" min="1"
value="1000" />
<label for="dimReductionIterations"># Iterations</label>
</div>
</div>
<div class="col-md-3">
<div class="form-floating mb-2">
<input id="scatterplotRadius" class="form-control w-100" type="number" min="1"
value="800" />
<label for="scatterplotRadius"># Radius</label>
</div>
</div>
<div class="col-md-4">
<div class="form-floating mb-2">
<input id="dimensionalityReductionSimilarityThreshold" class="form-control w-100"
type="number" min="0" max="1" step="0.01" value="0" />
<label for="dimensionalityReductionSimilarityThreshold"># Similarity
Threshold</label>
</div>
</div>
<div class="col-md-3">
<div class="form-floating mb-2">
<input id="colorBy" class="form-control w-100" type="text" value="None" />
<label for="colorBy">Color by</label>
</div>
</div>
<div class="col-md-1 d-flex flex-column align-items-center justify-content-center">
<label class="form-check-label" for="toggleOpacity" title="Similarity score determines point opacity">Opacity</label>
<div class="form-check form-switch" title="Similarity score determines point opacity">
<input class="form-check-input activeToggle" type="checkbox" id="toggleOpacity" checked>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="plot-container">
<canvas id="deckgl"></canvas>
</div>
</div>
</div>
<div id="tooltip" class="tooltip"></div>
</body>
</html>