Spaces:
Runtime error
Runtime error
stevenyh3
commited on
Commit
·
d7d8b33
1
Parent(s):
4c2f8ad
feat: add frontend design
Browse files- evals/.zeno_cache_emotional-intelligence/view.mjs +1574 -0
- evals/evals.yaml +2 -1
- frontend/package-lock.json +46 -1
- frontend/package.json +3 -1
- frontend/public/openai.svg +2 -0
- frontend/public/smui.css +0 -0
- frontend/public/vite.svg +0 -1
- frontend/src/App.svelte +97 -44
- frontend/src/assets/handshake.svelte +32 -0
- frontend/src/assets/svelte.svg +0 -1
- frontend/src/theme/_smui-theme.scss +9 -23
- zeno-evals-hub/frontend/index.html +18 -1
- zeno-evals-hub/main.py +25 -21
evals/.zeno_cache_emotional-intelligence/view.mjs
ADDED
|
@@ -0,0 +1,1574 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
function noop() { }
|
| 2 |
+
function run(fn) {
|
| 3 |
+
return fn();
|
| 4 |
+
}
|
| 5 |
+
function blank_object() {
|
| 6 |
+
return Object.create(null);
|
| 7 |
+
}
|
| 8 |
+
function run_all(fns) {
|
| 9 |
+
fns.forEach(run);
|
| 10 |
+
}
|
| 11 |
+
function is_function(thing) {
|
| 12 |
+
return typeof thing === 'function';
|
| 13 |
+
}
|
| 14 |
+
function safe_not_equal(a, b) {
|
| 15 |
+
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
| 16 |
+
}
|
| 17 |
+
function is_empty(obj) {
|
| 18 |
+
return Object.keys(obj).length === 0;
|
| 19 |
+
}
|
| 20 |
+
function null_to_empty(value) {
|
| 21 |
+
return value == null ? '' : value;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM
|
| 25 |
+
// at the end of hydration without touching the remaining nodes.
|
| 26 |
+
let is_hydrating = false;
|
| 27 |
+
function start_hydrating() {
|
| 28 |
+
is_hydrating = true;
|
| 29 |
+
}
|
| 30 |
+
function end_hydrating() {
|
| 31 |
+
is_hydrating = false;
|
| 32 |
+
}
|
| 33 |
+
function upper_bound(low, high, key, value) {
|
| 34 |
+
// Return first index of value larger than input value in the range [low, high)
|
| 35 |
+
while (low < high) {
|
| 36 |
+
const mid = low + ((high - low) >> 1);
|
| 37 |
+
if (key(mid) <= value) {
|
| 38 |
+
low = mid + 1;
|
| 39 |
+
}
|
| 40 |
+
else {
|
| 41 |
+
high = mid;
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
return low;
|
| 45 |
+
}
|
| 46 |
+
function init_hydrate(target) {
|
| 47 |
+
if (target.hydrate_init)
|
| 48 |
+
return;
|
| 49 |
+
target.hydrate_init = true;
|
| 50 |
+
// We know that all children have claim_order values since the unclaimed have been detached if target is not <head>
|
| 51 |
+
let children = target.childNodes;
|
| 52 |
+
// If target is <head>, there may be children without claim_order
|
| 53 |
+
if (target.nodeName === 'HEAD') {
|
| 54 |
+
const myChildren = [];
|
| 55 |
+
for (let i = 0; i < children.length; i++) {
|
| 56 |
+
const node = children[i];
|
| 57 |
+
if (node.claim_order !== undefined) {
|
| 58 |
+
myChildren.push(node);
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
children = myChildren;
|
| 62 |
+
}
|
| 63 |
+
/*
|
| 64 |
+
* Reorder claimed children optimally.
|
| 65 |
+
* We can reorder claimed children optimally by finding the longest subsequence of
|
| 66 |
+
* nodes that are already claimed in order and only moving the rest. The longest
|
| 67 |
+
* subsequence of nodes that are claimed in order can be found by
|
| 68 |
+
* computing the longest increasing subsequence of .claim_order values.
|
| 69 |
+
*
|
| 70 |
+
* This algorithm is optimal in generating the least amount of reorder operations
|
| 71 |
+
* possible.
|
| 72 |
+
*
|
| 73 |
+
* Proof:
|
| 74 |
+
* We know that, given a set of reordering operations, the nodes that do not move
|
| 75 |
+
* always form an increasing subsequence, since they do not move among each other
|
| 76 |
+
* meaning that they must be already ordered among each other. Thus, the maximal
|
| 77 |
+
* set of nodes that do not move form a longest increasing subsequence.
|
| 78 |
+
*/
|
| 79 |
+
// Compute longest increasing subsequence
|
| 80 |
+
// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j
|
| 81 |
+
const m = new Int32Array(children.length + 1);
|
| 82 |
+
// Predecessor indices + 1
|
| 83 |
+
const p = new Int32Array(children.length);
|
| 84 |
+
m[0] = -1;
|
| 85 |
+
let longest = 0;
|
| 86 |
+
for (let i = 0; i < children.length; i++) {
|
| 87 |
+
const current = children[i].claim_order;
|
| 88 |
+
// Find the largest subsequence length such that it ends in a value less than our current value
|
| 89 |
+
// upper_bound returns first greater value, so we subtract one
|
| 90 |
+
// with fast path for when we are on the current longest subsequence
|
| 91 |
+
const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;
|
| 92 |
+
p[i] = m[seqLen] + 1;
|
| 93 |
+
const newLen = seqLen + 1;
|
| 94 |
+
// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.
|
| 95 |
+
m[newLen] = i;
|
| 96 |
+
longest = Math.max(newLen, longest);
|
| 97 |
+
}
|
| 98 |
+
// The longest increasing subsequence of nodes (initially reversed)
|
| 99 |
+
const lis = [];
|
| 100 |
+
// The rest of the nodes, nodes that will be moved
|
| 101 |
+
const toMove = [];
|
| 102 |
+
let last = children.length - 1;
|
| 103 |
+
for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {
|
| 104 |
+
lis.push(children[cur - 1]);
|
| 105 |
+
for (; last >= cur; last--) {
|
| 106 |
+
toMove.push(children[last]);
|
| 107 |
+
}
|
| 108 |
+
last--;
|
| 109 |
+
}
|
| 110 |
+
for (; last >= 0; last--) {
|
| 111 |
+
toMove.push(children[last]);
|
| 112 |
+
}
|
| 113 |
+
lis.reverse();
|
| 114 |
+
// We sort the nodes being moved to guarantee that their insertion order matches the claim order
|
| 115 |
+
toMove.sort((a, b) => a.claim_order - b.claim_order);
|
| 116 |
+
// Finally, we move the nodes
|
| 117 |
+
for (let i = 0, j = 0; i < toMove.length; i++) {
|
| 118 |
+
while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {
|
| 119 |
+
j++;
|
| 120 |
+
}
|
| 121 |
+
const anchor = j < lis.length ? lis[j] : null;
|
| 122 |
+
target.insertBefore(toMove[i], anchor);
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
function append(target, node) {
|
| 126 |
+
target.appendChild(node);
|
| 127 |
+
}
|
| 128 |
+
function append_styles(target, style_sheet_id, styles) {
|
| 129 |
+
const append_styles_to = get_root_for_style(target);
|
| 130 |
+
if (!append_styles_to.getElementById(style_sheet_id)) {
|
| 131 |
+
const style = element('style');
|
| 132 |
+
style.id = style_sheet_id;
|
| 133 |
+
style.textContent = styles;
|
| 134 |
+
append_stylesheet(append_styles_to, style);
|
| 135 |
+
}
|
| 136 |
+
}
|
| 137 |
+
function get_root_for_style(node) {
|
| 138 |
+
if (!node)
|
| 139 |
+
return document;
|
| 140 |
+
const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
|
| 141 |
+
if (root && root.host) {
|
| 142 |
+
return root;
|
| 143 |
+
}
|
| 144 |
+
return node.ownerDocument;
|
| 145 |
+
}
|
| 146 |
+
function append_stylesheet(node, style) {
|
| 147 |
+
append(node.head || node, style);
|
| 148 |
+
return style.sheet;
|
| 149 |
+
}
|
| 150 |
+
function append_hydration(target, node) {
|
| 151 |
+
if (is_hydrating) {
|
| 152 |
+
init_hydrate(target);
|
| 153 |
+
if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) {
|
| 154 |
+
target.actual_end_child = target.firstChild;
|
| 155 |
+
}
|
| 156 |
+
// Skip nodes of undefined ordering
|
| 157 |
+
while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {
|
| 158 |
+
target.actual_end_child = target.actual_end_child.nextSibling;
|
| 159 |
+
}
|
| 160 |
+
if (node !== target.actual_end_child) {
|
| 161 |
+
// We only insert if the ordering of this node should be modified or the parent node is not target
|
| 162 |
+
if (node.claim_order !== undefined || node.parentNode !== target) {
|
| 163 |
+
target.insertBefore(node, target.actual_end_child);
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
else {
|
| 167 |
+
target.actual_end_child = node.nextSibling;
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
else if (node.parentNode !== target || node.nextSibling !== null) {
|
| 171 |
+
target.appendChild(node);
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
function insert_hydration(target, node, anchor) {
|
| 175 |
+
if (is_hydrating && !anchor) {
|
| 176 |
+
append_hydration(target, node);
|
| 177 |
+
}
|
| 178 |
+
else if (node.parentNode !== target || node.nextSibling != anchor) {
|
| 179 |
+
target.insertBefore(node, anchor || null);
|
| 180 |
+
}
|
| 181 |
+
}
|
| 182 |
+
function detach(node) {
|
| 183 |
+
if (node.parentNode) {
|
| 184 |
+
node.parentNode.removeChild(node);
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
function destroy_each(iterations, detaching) {
|
| 188 |
+
for (let i = 0; i < iterations.length; i += 1) {
|
| 189 |
+
if (iterations[i])
|
| 190 |
+
iterations[i].d(detaching);
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
function element(name) {
|
| 194 |
+
return document.createElement(name);
|
| 195 |
+
}
|
| 196 |
+
function svg_element(name) {
|
| 197 |
+
return document.createElementNS('http://www.w3.org/2000/svg', name);
|
| 198 |
+
}
|
| 199 |
+
function text(data) {
|
| 200 |
+
return document.createTextNode(data);
|
| 201 |
+
}
|
| 202 |
+
function space() {
|
| 203 |
+
return text(' ');
|
| 204 |
+
}
|
| 205 |
+
function empty() {
|
| 206 |
+
return text('');
|
| 207 |
+
}
|
| 208 |
+
function attr(node, attribute, value) {
|
| 209 |
+
if (value == null)
|
| 210 |
+
node.removeAttribute(attribute);
|
| 211 |
+
else if (node.getAttribute(attribute) !== value)
|
| 212 |
+
node.setAttribute(attribute, value);
|
| 213 |
+
}
|
| 214 |
+
function children(element) {
|
| 215 |
+
return Array.from(element.childNodes);
|
| 216 |
+
}
|
| 217 |
+
function init_claim_info(nodes) {
|
| 218 |
+
if (nodes.claim_info === undefined) {
|
| 219 |
+
nodes.claim_info = { last_index: 0, total_claimed: 0 };
|
| 220 |
+
}
|
| 221 |
+
}
|
| 222 |
+
function claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {
|
| 223 |
+
// Try to find nodes in an order such that we lengthen the longest increasing subsequence
|
| 224 |
+
init_claim_info(nodes);
|
| 225 |
+
const resultNode = (() => {
|
| 226 |
+
// We first try to find an element after the previous one
|
| 227 |
+
for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {
|
| 228 |
+
const node = nodes[i];
|
| 229 |
+
if (predicate(node)) {
|
| 230 |
+
const replacement = processNode(node);
|
| 231 |
+
if (replacement === undefined) {
|
| 232 |
+
nodes.splice(i, 1);
|
| 233 |
+
}
|
| 234 |
+
else {
|
| 235 |
+
nodes[i] = replacement;
|
| 236 |
+
}
|
| 237 |
+
if (!dontUpdateLastIndex) {
|
| 238 |
+
nodes.claim_info.last_index = i;
|
| 239 |
+
}
|
| 240 |
+
return node;
|
| 241 |
+
}
|
| 242 |
+
}
|
| 243 |
+
// Otherwise, we try to find one before
|
| 244 |
+
// We iterate in reverse so that we don't go too far back
|
| 245 |
+
for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {
|
| 246 |
+
const node = nodes[i];
|
| 247 |
+
if (predicate(node)) {
|
| 248 |
+
const replacement = processNode(node);
|
| 249 |
+
if (replacement === undefined) {
|
| 250 |
+
nodes.splice(i, 1);
|
| 251 |
+
}
|
| 252 |
+
else {
|
| 253 |
+
nodes[i] = replacement;
|
| 254 |
+
}
|
| 255 |
+
if (!dontUpdateLastIndex) {
|
| 256 |
+
nodes.claim_info.last_index = i;
|
| 257 |
+
}
|
| 258 |
+
else if (replacement === undefined) {
|
| 259 |
+
// Since we spliced before the last_index, we decrease it
|
| 260 |
+
nodes.claim_info.last_index--;
|
| 261 |
+
}
|
| 262 |
+
return node;
|
| 263 |
+
}
|
| 264 |
+
}
|
| 265 |
+
// If we can't find any matching node, we create a new one
|
| 266 |
+
return createNode();
|
| 267 |
+
})();
|
| 268 |
+
resultNode.claim_order = nodes.claim_info.total_claimed;
|
| 269 |
+
nodes.claim_info.total_claimed += 1;
|
| 270 |
+
return resultNode;
|
| 271 |
+
}
|
| 272 |
+
function claim_element_base(nodes, name, attributes, create_element) {
|
| 273 |
+
return claim_node(nodes, (node) => node.nodeName === name, (node) => {
|
| 274 |
+
const remove = [];
|
| 275 |
+
for (let j = 0; j < node.attributes.length; j++) {
|
| 276 |
+
const attribute = node.attributes[j];
|
| 277 |
+
if (!attributes[attribute.name]) {
|
| 278 |
+
remove.push(attribute.name);
|
| 279 |
+
}
|
| 280 |
+
}
|
| 281 |
+
remove.forEach(v => node.removeAttribute(v));
|
| 282 |
+
return undefined;
|
| 283 |
+
}, () => create_element(name));
|
| 284 |
+
}
|
| 285 |
+
function claim_element(nodes, name, attributes) {
|
| 286 |
+
return claim_element_base(nodes, name, attributes, element);
|
| 287 |
+
}
|
| 288 |
+
function claim_svg_element(nodes, name, attributes) {
|
| 289 |
+
return claim_element_base(nodes, name, attributes, svg_element);
|
| 290 |
+
}
|
| 291 |
+
function claim_text(nodes, data) {
|
| 292 |
+
return claim_node(nodes, (node) => node.nodeType === 3, (node) => {
|
| 293 |
+
const dataStr = '' + data;
|
| 294 |
+
if (node.data.startsWith(dataStr)) {
|
| 295 |
+
if (node.data.length !== dataStr.length) {
|
| 296 |
+
return node.splitText(dataStr.length);
|
| 297 |
+
}
|
| 298 |
+
}
|
| 299 |
+
else {
|
| 300 |
+
node.data = dataStr;
|
| 301 |
+
}
|
| 302 |
+
}, () => text(data), true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements
|
| 303 |
+
);
|
| 304 |
+
}
|
| 305 |
+
function claim_space(nodes) {
|
| 306 |
+
return claim_text(nodes, ' ');
|
| 307 |
+
}
|
| 308 |
+
function set_data(text, data) {
|
| 309 |
+
data = '' + data;
|
| 310 |
+
if (text.wholeText !== data)
|
| 311 |
+
text.data = data;
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
let current_component;
|
| 315 |
+
function set_current_component(component) {
|
| 316 |
+
current_component = component;
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
const dirty_components = [];
|
| 320 |
+
const binding_callbacks = [];
|
| 321 |
+
const render_callbacks = [];
|
| 322 |
+
const flush_callbacks = [];
|
| 323 |
+
const resolved_promise = Promise.resolve();
|
| 324 |
+
let update_scheduled = false;
|
| 325 |
+
function schedule_update() {
|
| 326 |
+
if (!update_scheduled) {
|
| 327 |
+
update_scheduled = true;
|
| 328 |
+
resolved_promise.then(flush);
|
| 329 |
+
}
|
| 330 |
+
}
|
| 331 |
+
function add_render_callback(fn) {
|
| 332 |
+
render_callbacks.push(fn);
|
| 333 |
+
}
|
| 334 |
+
// flush() calls callbacks in this order:
|
| 335 |
+
// 1. All beforeUpdate callbacks, in order: parents before children
|
| 336 |
+
// 2. All bind:this callbacks, in reverse order: children before parents.
|
| 337 |
+
// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
|
| 338 |
+
// for afterUpdates called during the initial onMount, which are called in
|
| 339 |
+
// reverse order: children before parents.
|
| 340 |
+
// Since callbacks might update component values, which could trigger another
|
| 341 |
+
// call to flush(), the following steps guard against this:
|
| 342 |
+
// 1. During beforeUpdate, any updated components will be added to the
|
| 343 |
+
// dirty_components array and will cause a reentrant call to flush(). Because
|
| 344 |
+
// the flush index is kept outside the function, the reentrant call will pick
|
| 345 |
+
// up where the earlier call left off and go through all dirty components. The
|
| 346 |
+
// current_component value is saved and restored so that the reentrant call will
|
| 347 |
+
// not interfere with the "parent" flush() call.
|
| 348 |
+
// 2. bind:this callbacks cannot trigger new flush() calls.
|
| 349 |
+
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
| 350 |
+
// callback called a second time; the seen_callbacks set, outside the flush()
|
| 351 |
+
// function, guarantees this behavior.
|
| 352 |
+
const seen_callbacks = new Set();
|
| 353 |
+
let flushidx = 0; // Do *not* move this inside the flush() function
|
| 354 |
+
function flush() {
|
| 355 |
+
// Do not reenter flush while dirty components are updated, as this can
|
| 356 |
+
// result in an infinite loop. Instead, let the inner flush handle it.
|
| 357 |
+
// Reentrancy is ok afterwards for bindings etc.
|
| 358 |
+
if (flushidx !== 0) {
|
| 359 |
+
return;
|
| 360 |
+
}
|
| 361 |
+
const saved_component = current_component;
|
| 362 |
+
do {
|
| 363 |
+
// first, call beforeUpdate functions
|
| 364 |
+
// and update components
|
| 365 |
+
try {
|
| 366 |
+
while (flushidx < dirty_components.length) {
|
| 367 |
+
const component = dirty_components[flushidx];
|
| 368 |
+
flushidx++;
|
| 369 |
+
set_current_component(component);
|
| 370 |
+
update(component.$$);
|
| 371 |
+
}
|
| 372 |
+
}
|
| 373 |
+
catch (e) {
|
| 374 |
+
// reset dirty state to not end up in a deadlocked state and then rethrow
|
| 375 |
+
dirty_components.length = 0;
|
| 376 |
+
flushidx = 0;
|
| 377 |
+
throw e;
|
| 378 |
+
}
|
| 379 |
+
set_current_component(null);
|
| 380 |
+
dirty_components.length = 0;
|
| 381 |
+
flushidx = 0;
|
| 382 |
+
while (binding_callbacks.length)
|
| 383 |
+
binding_callbacks.pop()();
|
| 384 |
+
// then, once components are updated, call
|
| 385 |
+
// afterUpdate functions. This may cause
|
| 386 |
+
// subsequent updates...
|
| 387 |
+
for (let i = 0; i < render_callbacks.length; i += 1) {
|
| 388 |
+
const callback = render_callbacks[i];
|
| 389 |
+
if (!seen_callbacks.has(callback)) {
|
| 390 |
+
// ...so guard against infinite loops
|
| 391 |
+
seen_callbacks.add(callback);
|
| 392 |
+
callback();
|
| 393 |
+
}
|
| 394 |
+
}
|
| 395 |
+
render_callbacks.length = 0;
|
| 396 |
+
} while (dirty_components.length);
|
| 397 |
+
while (flush_callbacks.length) {
|
| 398 |
+
flush_callbacks.pop()();
|
| 399 |
+
}
|
| 400 |
+
update_scheduled = false;
|
| 401 |
+
seen_callbacks.clear();
|
| 402 |
+
set_current_component(saved_component);
|
| 403 |
+
}
|
| 404 |
+
function update($$) {
|
| 405 |
+
if ($$.fragment !== null) {
|
| 406 |
+
$$.update();
|
| 407 |
+
run_all($$.before_update);
|
| 408 |
+
const dirty = $$.dirty;
|
| 409 |
+
$$.dirty = [-1];
|
| 410 |
+
$$.fragment && $$.fragment.p($$.ctx, dirty);
|
| 411 |
+
$$.after_update.forEach(add_render_callback);
|
| 412 |
+
}
|
| 413 |
+
}
|
| 414 |
+
const outroing = new Set();
|
| 415 |
+
let outros;
|
| 416 |
+
function group_outros() {
|
| 417 |
+
outros = {
|
| 418 |
+
r: 0,
|
| 419 |
+
c: [],
|
| 420 |
+
p: outros // parent group
|
| 421 |
+
};
|
| 422 |
+
}
|
| 423 |
+
function check_outros() {
|
| 424 |
+
if (!outros.r) {
|
| 425 |
+
run_all(outros.c);
|
| 426 |
+
}
|
| 427 |
+
outros = outros.p;
|
| 428 |
+
}
|
| 429 |
+
function transition_in(block, local) {
|
| 430 |
+
if (block && block.i) {
|
| 431 |
+
outroing.delete(block);
|
| 432 |
+
block.i(local);
|
| 433 |
+
}
|
| 434 |
+
}
|
| 435 |
+
function transition_out(block, local, detach, callback) {
|
| 436 |
+
if (block && block.o) {
|
| 437 |
+
if (outroing.has(block))
|
| 438 |
+
return;
|
| 439 |
+
outroing.add(block);
|
| 440 |
+
outros.c.push(() => {
|
| 441 |
+
outroing.delete(block);
|
| 442 |
+
if (callback) {
|
| 443 |
+
if (detach)
|
| 444 |
+
block.d(1);
|
| 445 |
+
callback();
|
| 446 |
+
}
|
| 447 |
+
});
|
| 448 |
+
block.o(local);
|
| 449 |
+
}
|
| 450 |
+
else if (callback) {
|
| 451 |
+
callback();
|
| 452 |
+
}
|
| 453 |
+
}
|
| 454 |
+
function create_component(block) {
|
| 455 |
+
block && block.c();
|
| 456 |
+
}
|
| 457 |
+
function claim_component(block, parent_nodes) {
|
| 458 |
+
block && block.l(parent_nodes);
|
| 459 |
+
}
|
| 460 |
+
function mount_component(component, target, anchor, customElement) {
|
| 461 |
+
const { fragment, after_update } = component.$$;
|
| 462 |
+
fragment && fragment.m(target, anchor);
|
| 463 |
+
if (!customElement) {
|
| 464 |
+
// onMount happens before the initial afterUpdate
|
| 465 |
+
add_render_callback(() => {
|
| 466 |
+
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
| 467 |
+
// if the component was destroyed immediately
|
| 468 |
+
// it will update the `$$.on_destroy` reference to `null`.
|
| 469 |
+
// the destructured on_destroy may still reference to the old array
|
| 470 |
+
if (component.$$.on_destroy) {
|
| 471 |
+
component.$$.on_destroy.push(...new_on_destroy);
|
| 472 |
+
}
|
| 473 |
+
else {
|
| 474 |
+
// Edge case - component was destroyed immediately,
|
| 475 |
+
// most likely as a result of a binding initialising
|
| 476 |
+
run_all(new_on_destroy);
|
| 477 |
+
}
|
| 478 |
+
component.$$.on_mount = [];
|
| 479 |
+
});
|
| 480 |
+
}
|
| 481 |
+
after_update.forEach(add_render_callback);
|
| 482 |
+
}
|
| 483 |
+
function destroy_component(component, detaching) {
|
| 484 |
+
const $$ = component.$$;
|
| 485 |
+
if ($$.fragment !== null) {
|
| 486 |
+
run_all($$.on_destroy);
|
| 487 |
+
$$.fragment && $$.fragment.d(detaching);
|
| 488 |
+
// TODO null out other refs, including component.$$ (but need to
|
| 489 |
+
// preserve final state?)
|
| 490 |
+
$$.on_destroy = $$.fragment = null;
|
| 491 |
+
$$.ctx = [];
|
| 492 |
+
}
|
| 493 |
+
}
|
| 494 |
+
function make_dirty(component, i) {
|
| 495 |
+
if (component.$$.dirty[0] === -1) {
|
| 496 |
+
dirty_components.push(component);
|
| 497 |
+
schedule_update();
|
| 498 |
+
component.$$.dirty.fill(0);
|
| 499 |
+
}
|
| 500 |
+
component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
|
| 501 |
+
}
|
| 502 |
+
function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
|
| 503 |
+
const parent_component = current_component;
|
| 504 |
+
set_current_component(component);
|
| 505 |
+
const $$ = component.$$ = {
|
| 506 |
+
fragment: null,
|
| 507 |
+
ctx: [],
|
| 508 |
+
// state
|
| 509 |
+
props,
|
| 510 |
+
update: noop,
|
| 511 |
+
not_equal,
|
| 512 |
+
bound: blank_object(),
|
| 513 |
+
// lifecycle
|
| 514 |
+
on_mount: [],
|
| 515 |
+
on_destroy: [],
|
| 516 |
+
on_disconnect: [],
|
| 517 |
+
before_update: [],
|
| 518 |
+
after_update: [],
|
| 519 |
+
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
| 520 |
+
// everything else
|
| 521 |
+
callbacks: blank_object(),
|
| 522 |
+
dirty,
|
| 523 |
+
skip_bound: false,
|
| 524 |
+
root: options.target || parent_component.$$.root
|
| 525 |
+
};
|
| 526 |
+
append_styles && append_styles($$.root);
|
| 527 |
+
let ready = false;
|
| 528 |
+
$$.ctx = instance
|
| 529 |
+
? instance(component, options.props || {}, (i, ret, ...rest) => {
|
| 530 |
+
const value = rest.length ? rest[0] : ret;
|
| 531 |
+
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
| 532 |
+
if (!$$.skip_bound && $$.bound[i])
|
| 533 |
+
$$.bound[i](value);
|
| 534 |
+
if (ready)
|
| 535 |
+
make_dirty(component, i);
|
| 536 |
+
}
|
| 537 |
+
return ret;
|
| 538 |
+
})
|
| 539 |
+
: [];
|
| 540 |
+
$$.update();
|
| 541 |
+
ready = true;
|
| 542 |
+
run_all($$.before_update);
|
| 543 |
+
// `false` as a special case of no DOM component
|
| 544 |
+
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
|
| 545 |
+
if (options.target) {
|
| 546 |
+
if (options.hydrate) {
|
| 547 |
+
start_hydrating();
|
| 548 |
+
const nodes = children(options.target);
|
| 549 |
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
| 550 |
+
$$.fragment && $$.fragment.l(nodes);
|
| 551 |
+
nodes.forEach(detach);
|
| 552 |
+
}
|
| 553 |
+
else {
|
| 554 |
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
| 555 |
+
$$.fragment && $$.fragment.c();
|
| 556 |
+
}
|
| 557 |
+
if (options.intro)
|
| 558 |
+
transition_in(component.$$.fragment);
|
| 559 |
+
mount_component(component, options.target, options.anchor, options.customElement);
|
| 560 |
+
end_hydrating();
|
| 561 |
+
flush();
|
| 562 |
+
}
|
| 563 |
+
set_current_component(parent_component);
|
| 564 |
+
}
|
| 565 |
+
/**
|
| 566 |
+
* Base class for Svelte components. Used when dev=false.
|
| 567 |
+
*/
|
| 568 |
+
class SvelteComponent {
|
| 569 |
+
$destroy() {
|
| 570 |
+
destroy_component(this, 1);
|
| 571 |
+
this.$destroy = noop;
|
| 572 |
+
}
|
| 573 |
+
$on(type, callback) {
|
| 574 |
+
if (!is_function(callback)) {
|
| 575 |
+
return noop;
|
| 576 |
+
}
|
| 577 |
+
const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
|
| 578 |
+
callbacks.push(callback);
|
| 579 |
+
return () => {
|
| 580 |
+
const index = callbacks.indexOf(callback);
|
| 581 |
+
if (index !== -1)
|
| 582 |
+
callbacks.splice(index, 1);
|
| 583 |
+
};
|
| 584 |
+
}
|
| 585 |
+
$set($$props) {
|
| 586 |
+
if (this.$$set && !is_empty($$props)) {
|
| 587 |
+
this.$$.skip_bound = true;
|
| 588 |
+
this.$$set($$props);
|
| 589 |
+
this.$$.skip_bound = false;
|
| 590 |
+
}
|
| 591 |
+
}
|
| 592 |
+
}
|
| 593 |
+
|
| 594 |
+
/* src/AssistantBlock.svelte generated by Svelte v3.55.1 */
|
| 595 |
+
|
| 596 |
+
function add_css$3(target) {
|
| 597 |
+
append_styles(target, "svelte-1e3mbn4", ".model.svelte-1e3mbn4.svelte-1e3mbn4{fill:var(--logo)}.no-model.svelte-1e3mbn4.svelte-1e3mbn4{fill:var(--G3)}.model-border.svelte-1e3mbn4.svelte-1e3mbn4{border:1px solid var(--logo)}.no-model-border.svelte-1e3mbn4.svelte-1e3mbn4{border:1px solid rgba(224, 224, 224, 1)}.box.svelte-1e3mbn4.svelte-1e3mbn4{margin-top:10px;margin-bottom:10px;display:flex;align-items:start}.box.svelte-1e3mbn4 svg.svelte-1e3mbn4{min-width:24px;width:24px;margin-right:10px;margin-top:7px}.chat.svelte-1e3mbn4.svelte-1e3mbn4{border-radius:5px;margin:0px;padding:10px;overflow-wrap:anywhere}");
|
| 598 |
+
}
|
| 599 |
+
|
| 600 |
+
function create_fragment$3(ctx) {
|
| 601 |
+
let div;
|
| 602 |
+
let svg;
|
| 603 |
+
let path;
|
| 604 |
+
let svg_class_value;
|
| 605 |
+
let t0;
|
| 606 |
+
let p;
|
| 607 |
+
let t1;
|
| 608 |
+
let p_class_value;
|
| 609 |
+
|
| 610 |
+
return {
|
| 611 |
+
c() {
|
| 612 |
+
div = element("div");
|
| 613 |
+
svg = svg_element("svg");
|
| 614 |
+
path = svg_element("path");
|
| 615 |
+
t0 = space();
|
| 616 |
+
p = element("p");
|
| 617 |
+
t1 = text(/*input*/ ctx[0]);
|
| 618 |
+
this.h();
|
| 619 |
+
},
|
| 620 |
+
l(nodes) {
|
| 621 |
+
div = claim_element(nodes, "DIV", { class: true });
|
| 622 |
+
var div_nodes = children(div);
|
| 623 |
+
svg = claim_svg_element(div_nodes, "svg", { xmlns: true, viewBox: true, class: true });
|
| 624 |
+
var svg_nodes = children(svg);
|
| 625 |
+
path = claim_svg_element(svg_nodes, "path", { d: true });
|
| 626 |
+
children(path).forEach(detach);
|
| 627 |
+
svg_nodes.forEach(detach);
|
| 628 |
+
t0 = claim_space(div_nodes);
|
| 629 |
+
p = claim_element(div_nodes, "P", { class: true });
|
| 630 |
+
var p_nodes = children(p);
|
| 631 |
+
t1 = claim_text(p_nodes, /*input*/ ctx[0]);
|
| 632 |
+
p_nodes.forEach(detach);
|
| 633 |
+
div_nodes.forEach(detach);
|
| 634 |
+
this.h();
|
| 635 |
+
},
|
| 636 |
+
h() {
|
| 637 |
+
attr(path, "d", "M320 0c17.7 0 32 14.3 32 32V96H472c39.8 0 72 32.2 72 72V440c0 39.8-32.2 72-72 72H168c-39.8 0-72-32.2-72-72V168c0-39.8 32.2-72 72-72H288V32c0-17.7 14.3-32 32-32zM208 384c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H208zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H304zm96 0c-8.8 0-16 7.2-16 16s7.2 16 16 16h32c8.8 0 16-7.2 16-16s-7.2-16-16-16H400zM264 256a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm152 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM48 224H64V416H48c-26.5 0-48-21.5-48-48V272c0-26.5 21.5-48 48-48zm544 0c26.5 0 48 21.5 48 48v96c0 26.5-21.5 48-48 48H576V224h16z");
|
| 638 |
+
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
| 639 |
+
attr(svg, "viewBox", "0 0 640 512");
|
| 640 |
+
attr(svg, "class", svg_class_value = "" + (null_to_empty(/*output*/ ctx[1] ? "model" : "no-model") + " svelte-1e3mbn4"));
|
| 641 |
+
attr(p, "class", p_class_value = "chat " + (/*output*/ ctx[1] ? 'model-border' : 'no-model-border') + " svelte-1e3mbn4");
|
| 642 |
+
attr(div, "class", "box svelte-1e3mbn4");
|
| 643 |
+
},
|
| 644 |
+
m(target, anchor) {
|
| 645 |
+
insert_hydration(target, div, anchor);
|
| 646 |
+
append_hydration(div, svg);
|
| 647 |
+
append_hydration(svg, path);
|
| 648 |
+
append_hydration(div, t0);
|
| 649 |
+
append_hydration(div, p);
|
| 650 |
+
append_hydration(p, t1);
|
| 651 |
+
},
|
| 652 |
+
p(ctx, [dirty]) {
|
| 653 |
+
if (dirty & /*output*/ 2 && svg_class_value !== (svg_class_value = "" + (null_to_empty(/*output*/ ctx[1] ? "model" : "no-model") + " svelte-1e3mbn4"))) {
|
| 654 |
+
attr(svg, "class", svg_class_value);
|
| 655 |
+
}
|
| 656 |
+
|
| 657 |
+
if (dirty & /*input*/ 1) set_data(t1, /*input*/ ctx[0]);
|
| 658 |
+
|
| 659 |
+
if (dirty & /*output*/ 2 && p_class_value !== (p_class_value = "chat " + (/*output*/ ctx[1] ? 'model-border' : 'no-model-border') + " svelte-1e3mbn4")) {
|
| 660 |
+
attr(p, "class", p_class_value);
|
| 661 |
+
}
|
| 662 |
+
},
|
| 663 |
+
i: noop,
|
| 664 |
+
o: noop,
|
| 665 |
+
d(detaching) {
|
| 666 |
+
if (detaching) detach(div);
|
| 667 |
+
}
|
| 668 |
+
};
|
| 669 |
+
}
|
| 670 |
+
|
| 671 |
+
function instance$3($$self, $$props, $$invalidate) {
|
| 672 |
+
let { input } = $$props;
|
| 673 |
+
let { output = false } = $$props;
|
| 674 |
+
|
| 675 |
+
$$self.$$set = $$props => {
|
| 676 |
+
if ('input' in $$props) $$invalidate(0, input = $$props.input);
|
| 677 |
+
if ('output' in $$props) $$invalidate(1, output = $$props.output);
|
| 678 |
+
};
|
| 679 |
+
|
| 680 |
+
return [input, output];
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
+
class AssistantBlock extends SvelteComponent {
|
| 684 |
+
constructor(options) {
|
| 685 |
+
super();
|
| 686 |
+
init(this, options, instance$3, create_fragment$3, safe_not_equal, { input: 0, output: 1 }, add_css$3);
|
| 687 |
+
}
|
| 688 |
+
}
|
| 689 |
+
|
| 690 |
+
/* src/SystemBlock.svelte generated by Svelte v3.55.1 */
|
| 691 |
+
|
| 692 |
+
function add_css$2(target) {
|
| 693 |
+
append_styles(target, "svelte-18o0ab2", "p.svelte-18o0ab2{margin:0px}");
|
| 694 |
+
}
|
| 695 |
+
|
| 696 |
+
function create_fragment$2(ctx) {
|
| 697 |
+
let p;
|
| 698 |
+
let b;
|
| 699 |
+
let t0;
|
| 700 |
+
let t1;
|
| 701 |
+
let span;
|
| 702 |
+
let t2;
|
| 703 |
+
|
| 704 |
+
return {
|
| 705 |
+
c() {
|
| 706 |
+
p = element("p");
|
| 707 |
+
b = element("b");
|
| 708 |
+
t0 = text("System:");
|
| 709 |
+
t1 = space();
|
| 710 |
+
span = element("span");
|
| 711 |
+
t2 = text(/*input*/ ctx[0]);
|
| 712 |
+
this.h();
|
| 713 |
+
},
|
| 714 |
+
l(nodes) {
|
| 715 |
+
p = claim_element(nodes, "P", { class: true });
|
| 716 |
+
var p_nodes = children(p);
|
| 717 |
+
b = claim_element(p_nodes, "B", {});
|
| 718 |
+
var b_nodes = children(b);
|
| 719 |
+
t0 = claim_text(b_nodes, "System:");
|
| 720 |
+
b_nodes.forEach(detach);
|
| 721 |
+
t1 = claim_space(p_nodes);
|
| 722 |
+
span = claim_element(p_nodes, "SPAN", {});
|
| 723 |
+
var span_nodes = children(span);
|
| 724 |
+
t2 = claim_text(span_nodes, /*input*/ ctx[0]);
|
| 725 |
+
span_nodes.forEach(detach);
|
| 726 |
+
p_nodes.forEach(detach);
|
| 727 |
+
this.h();
|
| 728 |
+
},
|
| 729 |
+
h() {
|
| 730 |
+
attr(p, "class", "svelte-18o0ab2");
|
| 731 |
+
},
|
| 732 |
+
m(target, anchor) {
|
| 733 |
+
insert_hydration(target, p, anchor);
|
| 734 |
+
append_hydration(p, b);
|
| 735 |
+
append_hydration(b, t0);
|
| 736 |
+
append_hydration(p, t1);
|
| 737 |
+
append_hydration(p, span);
|
| 738 |
+
append_hydration(span, t2);
|
| 739 |
+
},
|
| 740 |
+
p(ctx, [dirty]) {
|
| 741 |
+
if (dirty & /*input*/ 1) set_data(t2, /*input*/ ctx[0]);
|
| 742 |
+
},
|
| 743 |
+
i: noop,
|
| 744 |
+
o: noop,
|
| 745 |
+
d(detaching) {
|
| 746 |
+
if (detaching) detach(p);
|
| 747 |
+
}
|
| 748 |
+
};
|
| 749 |
+
}
|
| 750 |
+
|
| 751 |
+
function instance$2($$self, $$props, $$invalidate) {
|
| 752 |
+
let { input } = $$props;
|
| 753 |
+
|
| 754 |
+
$$self.$$set = $$props => {
|
| 755 |
+
if ('input' in $$props) $$invalidate(0, input = $$props.input);
|
| 756 |
+
};
|
| 757 |
+
|
| 758 |
+
return [input];
|
| 759 |
+
}
|
| 760 |
+
|
| 761 |
+
class SystemBlock extends SvelteComponent {
|
| 762 |
+
constructor(options) {
|
| 763 |
+
super();
|
| 764 |
+
init(this, options, instance$2, create_fragment$2, safe_not_equal, { input: 0 }, add_css$2);
|
| 765 |
+
}
|
| 766 |
+
}
|
| 767 |
+
|
| 768 |
+
/* src/UserBlock.svelte generated by Svelte v3.55.1 */
|
| 769 |
+
|
| 770 |
+
function add_css$1(target) {
|
| 771 |
+
append_styles(target, "svelte-1lys9p1", ".box.svelte-1lys9p1.svelte-1lys9p1{margin-top:10px;margin-bottom:10px;display:flex;align-items:start}.box.svelte-1lys9p1 svg.svelte-1lys9p1{min-width:24px;width:24px;margin-right:10px;margin-top:7px;fill:var(--G3)}.chat.svelte-1lys9p1.svelte-1lys9p1{border:1px solid rgba(224, 224, 224, 1);border-radius:5px;margin:0px;padding:10px;overflow-wrap:anywhere}");
|
| 772 |
+
}
|
| 773 |
+
|
| 774 |
+
function create_fragment$1(ctx) {
|
| 775 |
+
let div;
|
| 776 |
+
let svg;
|
| 777 |
+
let path;
|
| 778 |
+
let t0;
|
| 779 |
+
let p;
|
| 780 |
+
let t1;
|
| 781 |
+
|
| 782 |
+
return {
|
| 783 |
+
c() {
|
| 784 |
+
div = element("div");
|
| 785 |
+
svg = svg_element("svg");
|
| 786 |
+
path = svg_element("path");
|
| 787 |
+
t0 = space();
|
| 788 |
+
p = element("p");
|
| 789 |
+
t1 = text(/*input*/ ctx[0]);
|
| 790 |
+
this.h();
|
| 791 |
+
},
|
| 792 |
+
l(nodes) {
|
| 793 |
+
div = claim_element(nodes, "DIV", { class: true });
|
| 794 |
+
var div_nodes = children(div);
|
| 795 |
+
svg = claim_svg_element(div_nodes, "svg", { xmlns: true, viewBox: true, class: true });
|
| 796 |
+
var svg_nodes = children(svg);
|
| 797 |
+
path = claim_svg_element(svg_nodes, "path", { d: true });
|
| 798 |
+
children(path).forEach(detach);
|
| 799 |
+
svg_nodes.forEach(detach);
|
| 800 |
+
t0 = claim_space(div_nodes);
|
| 801 |
+
p = claim_element(div_nodes, "P", { class: true });
|
| 802 |
+
var p_nodes = children(p);
|
| 803 |
+
t1 = claim_text(p_nodes, /*input*/ ctx[0]);
|
| 804 |
+
p_nodes.forEach(detach);
|
| 805 |
+
div_nodes.forEach(detach);
|
| 806 |
+
this.h();
|
| 807 |
+
},
|
| 808 |
+
h() {
|
| 809 |
+
attr(path, "d", "M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304H178.3z");
|
| 810 |
+
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
| 811 |
+
attr(svg, "viewBox", "0 0 448 512");
|
| 812 |
+
attr(svg, "class", "svelte-1lys9p1");
|
| 813 |
+
attr(p, "class", "chat svelte-1lys9p1");
|
| 814 |
+
attr(div, "class", "box svelte-1lys9p1");
|
| 815 |
+
},
|
| 816 |
+
m(target, anchor) {
|
| 817 |
+
insert_hydration(target, div, anchor);
|
| 818 |
+
append_hydration(div, svg);
|
| 819 |
+
append_hydration(svg, path);
|
| 820 |
+
append_hydration(div, t0);
|
| 821 |
+
append_hydration(div, p);
|
| 822 |
+
append_hydration(p, t1);
|
| 823 |
+
},
|
| 824 |
+
p(ctx, [dirty]) {
|
| 825 |
+
if (dirty & /*input*/ 1) set_data(t1, /*input*/ ctx[0]);
|
| 826 |
+
},
|
| 827 |
+
i: noop,
|
| 828 |
+
o: noop,
|
| 829 |
+
d(detaching) {
|
| 830 |
+
if (detaching) detach(div);
|
| 831 |
+
}
|
| 832 |
+
};
|
| 833 |
+
}
|
| 834 |
+
|
| 835 |
+
function instance$1($$self, $$props, $$invalidate) {
|
| 836 |
+
let { input } = $$props;
|
| 837 |
+
|
| 838 |
+
$$self.$$set = $$props => {
|
| 839 |
+
if ('input' in $$props) $$invalidate(0, input = $$props.input);
|
| 840 |
+
};
|
| 841 |
+
|
| 842 |
+
return [input];
|
| 843 |
+
}
|
| 844 |
+
|
| 845 |
+
class UserBlock extends SvelteComponent {
|
| 846 |
+
constructor(options) {
|
| 847 |
+
super();
|
| 848 |
+
init(this, options, instance$1, create_fragment$1, safe_not_equal, { input: 0 }, add_css$1);
|
| 849 |
+
}
|
| 850 |
+
}
|
| 851 |
+
|
| 852 |
+
/* src/InstanceView.svelte generated by Svelte v3.55.1 */
|
| 853 |
+
|
| 854 |
+
function add_css(target) {
|
| 855 |
+
append_styles(target, "svelte-eoma5v", "#container.svelte-eoma5v{border:0.5px solid rgb(224, 224, 224);min-width:350px;border-radius:2px;padding:10px}.label.svelte-eoma5v{margin-right:5px;font-weight:700}p.svelte-eoma5v{margin:5px;overflow-wrap:anywhere}");
|
| 856 |
+
}
|
| 857 |
+
|
| 858 |
+
function get_each_context(ctx, list, i) {
|
| 859 |
+
const child_ctx = ctx.slice();
|
| 860 |
+
child_ctx[6] = list[i];
|
| 861 |
+
return child_ctx;
|
| 862 |
+
}
|
| 863 |
+
|
| 864 |
+
// (21:2) {#if entry[dataColumn]}
|
| 865 |
+
function create_if_block_2(ctx) {
|
| 866 |
+
let current_block_type_index;
|
| 867 |
+
let if_block;
|
| 868 |
+
let if_block_anchor;
|
| 869 |
+
let current;
|
| 870 |
+
const if_block_creators = [create_if_block_3, create_else_block];
|
| 871 |
+
const if_blocks = [];
|
| 872 |
+
|
| 873 |
+
function select_block_type(ctx, dirty) {
|
| 874 |
+
if (typeof /*entry*/ ctx[0][/*dataColumn*/ ctx[3]] === "string") return 0;
|
| 875 |
+
return 1;
|
| 876 |
+
}
|
| 877 |
+
|
| 878 |
+
current_block_type_index = select_block_type(ctx);
|
| 879 |
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
| 880 |
+
|
| 881 |
+
return {
|
| 882 |
+
c() {
|
| 883 |
+
if_block.c();
|
| 884 |
+
if_block_anchor = empty();
|
| 885 |
+
},
|
| 886 |
+
l(nodes) {
|
| 887 |
+
if_block.l(nodes);
|
| 888 |
+
if_block_anchor = empty();
|
| 889 |
+
},
|
| 890 |
+
m(target, anchor) {
|
| 891 |
+
if_blocks[current_block_type_index].m(target, anchor);
|
| 892 |
+
insert_hydration(target, if_block_anchor, anchor);
|
| 893 |
+
current = true;
|
| 894 |
+
},
|
| 895 |
+
p(ctx, dirty) {
|
| 896 |
+
let previous_block_index = current_block_type_index;
|
| 897 |
+
current_block_type_index = select_block_type(ctx);
|
| 898 |
+
|
| 899 |
+
if (current_block_type_index === previous_block_index) {
|
| 900 |
+
if_blocks[current_block_type_index].p(ctx, dirty);
|
| 901 |
+
} else {
|
| 902 |
+
group_outros();
|
| 903 |
+
|
| 904 |
+
transition_out(if_blocks[previous_block_index], 1, 1, () => {
|
| 905 |
+
if_blocks[previous_block_index] = null;
|
| 906 |
+
});
|
| 907 |
+
|
| 908 |
+
check_outros();
|
| 909 |
+
if_block = if_blocks[current_block_type_index];
|
| 910 |
+
|
| 911 |
+
if (!if_block) {
|
| 912 |
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
| 913 |
+
if_block.c();
|
| 914 |
+
} else {
|
| 915 |
+
if_block.p(ctx, dirty);
|
| 916 |
+
}
|
| 917 |
+
|
| 918 |
+
transition_in(if_block, 1);
|
| 919 |
+
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
| 920 |
+
}
|
| 921 |
+
},
|
| 922 |
+
i(local) {
|
| 923 |
+
if (current) return;
|
| 924 |
+
transition_in(if_block);
|
| 925 |
+
current = true;
|
| 926 |
+
},
|
| 927 |
+
o(local) {
|
| 928 |
+
transition_out(if_block);
|
| 929 |
+
current = false;
|
| 930 |
+
},
|
| 931 |
+
d(detaching) {
|
| 932 |
+
if_blocks[current_block_type_index].d(detaching);
|
| 933 |
+
if (detaching) detach(if_block_anchor);
|
| 934 |
+
}
|
| 935 |
+
};
|
| 936 |
+
}
|
| 937 |
+
|
| 938 |
+
// (24:4) {:else}
|
| 939 |
+
function create_else_block(ctx) {
|
| 940 |
+
let each_1_anchor;
|
| 941 |
+
let current;
|
| 942 |
+
let each_value = /*entry*/ ctx[0][/*dataColumn*/ ctx[3]];
|
| 943 |
+
let each_blocks = [];
|
| 944 |
+
|
| 945 |
+
for (let i = 0; i < each_value.length; i += 1) {
|
| 946 |
+
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
| 947 |
+
}
|
| 948 |
+
|
| 949 |
+
const out = i => transition_out(each_blocks[i], 1, 1, () => {
|
| 950 |
+
each_blocks[i] = null;
|
| 951 |
+
});
|
| 952 |
+
|
| 953 |
+
return {
|
| 954 |
+
c() {
|
| 955 |
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
| 956 |
+
each_blocks[i].c();
|
| 957 |
+
}
|
| 958 |
+
|
| 959 |
+
each_1_anchor = empty();
|
| 960 |
+
},
|
| 961 |
+
l(nodes) {
|
| 962 |
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
| 963 |
+
each_blocks[i].l(nodes);
|
| 964 |
+
}
|
| 965 |
+
|
| 966 |
+
each_1_anchor = empty();
|
| 967 |
+
},
|
| 968 |
+
m(target, anchor) {
|
| 969 |
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
| 970 |
+
each_blocks[i].m(target, anchor);
|
| 971 |
+
}
|
| 972 |
+
|
| 973 |
+
insert_hydration(target, each_1_anchor, anchor);
|
| 974 |
+
current = true;
|
| 975 |
+
},
|
| 976 |
+
p(ctx, dirty) {
|
| 977 |
+
if (dirty & /*entry, dataColumn*/ 9) {
|
| 978 |
+
each_value = /*entry*/ ctx[0][/*dataColumn*/ ctx[3]];
|
| 979 |
+
let i;
|
| 980 |
+
|
| 981 |
+
for (i = 0; i < each_value.length; i += 1) {
|
| 982 |
+
const child_ctx = get_each_context(ctx, each_value, i);
|
| 983 |
+
|
| 984 |
+
if (each_blocks[i]) {
|
| 985 |
+
each_blocks[i].p(child_ctx, dirty);
|
| 986 |
+
transition_in(each_blocks[i], 1);
|
| 987 |
+
} else {
|
| 988 |
+
each_blocks[i] = create_each_block(child_ctx);
|
| 989 |
+
each_blocks[i].c();
|
| 990 |
+
transition_in(each_blocks[i], 1);
|
| 991 |
+
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
|
| 992 |
+
}
|
| 993 |
+
}
|
| 994 |
+
|
| 995 |
+
group_outros();
|
| 996 |
+
|
| 997 |
+
for (i = each_value.length; i < each_blocks.length; i += 1) {
|
| 998 |
+
out(i);
|
| 999 |
+
}
|
| 1000 |
+
|
| 1001 |
+
check_outros();
|
| 1002 |
+
}
|
| 1003 |
+
},
|
| 1004 |
+
i(local) {
|
| 1005 |
+
if (current) return;
|
| 1006 |
+
|
| 1007 |
+
for (let i = 0; i < each_value.length; i += 1) {
|
| 1008 |
+
transition_in(each_blocks[i]);
|
| 1009 |
+
}
|
| 1010 |
+
|
| 1011 |
+
current = true;
|
| 1012 |
+
},
|
| 1013 |
+
o(local) {
|
| 1014 |
+
each_blocks = each_blocks.filter(Boolean);
|
| 1015 |
+
|
| 1016 |
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
| 1017 |
+
transition_out(each_blocks[i]);
|
| 1018 |
+
}
|
| 1019 |
+
|
| 1020 |
+
current = false;
|
| 1021 |
+
},
|
| 1022 |
+
d(detaching) {
|
| 1023 |
+
destroy_each(each_blocks, detaching);
|
| 1024 |
+
if (detaching) detach(each_1_anchor);
|
| 1025 |
+
}
|
| 1026 |
+
};
|
| 1027 |
+
}
|
| 1028 |
+
|
| 1029 |
+
// (22:4) {#if typeof entry[dataColumn] === "string"}
|
| 1030 |
+
function create_if_block_3(ctx) {
|
| 1031 |
+
let userblock;
|
| 1032 |
+
let current;
|
| 1033 |
+
|
| 1034 |
+
userblock = new UserBlock({
|
| 1035 |
+
props: {
|
| 1036 |
+
input: /*entry*/ ctx[0][/*dataColumn*/ ctx[3]]
|
| 1037 |
+
}
|
| 1038 |
+
});
|
| 1039 |
+
|
| 1040 |
+
return {
|
| 1041 |
+
c() {
|
| 1042 |
+
create_component(userblock.$$.fragment);
|
| 1043 |
+
},
|
| 1044 |
+
l(nodes) {
|
| 1045 |
+
claim_component(userblock.$$.fragment, nodes);
|
| 1046 |
+
},
|
| 1047 |
+
m(target, anchor) {
|
| 1048 |
+
mount_component(userblock, target, anchor);
|
| 1049 |
+
current = true;
|
| 1050 |
+
},
|
| 1051 |
+
p(ctx, dirty) {
|
| 1052 |
+
const userblock_changes = {};
|
| 1053 |
+
if (dirty & /*entry, dataColumn*/ 9) userblock_changes.input = /*entry*/ ctx[0][/*dataColumn*/ ctx[3]];
|
| 1054 |
+
userblock.$set(userblock_changes);
|
| 1055 |
+
},
|
| 1056 |
+
i(local) {
|
| 1057 |
+
if (current) return;
|
| 1058 |
+
transition_in(userblock.$$.fragment, local);
|
| 1059 |
+
current = true;
|
| 1060 |
+
},
|
| 1061 |
+
o(local) {
|
| 1062 |
+
transition_out(userblock.$$.fragment, local);
|
| 1063 |
+
current = false;
|
| 1064 |
+
},
|
| 1065 |
+
d(detaching) {
|
| 1066 |
+
destroy_component(userblock, detaching);
|
| 1067 |
+
}
|
| 1068 |
+
};
|
| 1069 |
+
}
|
| 1070 |
+
|
| 1071 |
+
// (30:42)
|
| 1072 |
+
function create_if_block_6(ctx) {
|
| 1073 |
+
let userblock;
|
| 1074 |
+
let current;
|
| 1075 |
+
|
| 1076 |
+
userblock = new UserBlock({
|
| 1077 |
+
props: { input: /*item*/ ctx[6]["content"] }
|
| 1078 |
+
});
|
| 1079 |
+
|
| 1080 |
+
return {
|
| 1081 |
+
c() {
|
| 1082 |
+
create_component(userblock.$$.fragment);
|
| 1083 |
+
},
|
| 1084 |
+
l(nodes) {
|
| 1085 |
+
claim_component(userblock.$$.fragment, nodes);
|
| 1086 |
+
},
|
| 1087 |
+
m(target, anchor) {
|
| 1088 |
+
mount_component(userblock, target, anchor);
|
| 1089 |
+
current = true;
|
| 1090 |
+
},
|
| 1091 |
+
p(ctx, dirty) {
|
| 1092 |
+
const userblock_changes = {};
|
| 1093 |
+
if (dirty & /*entry, dataColumn*/ 9) userblock_changes.input = /*item*/ ctx[6]["content"];
|
| 1094 |
+
userblock.$set(userblock_changes);
|
| 1095 |
+
},
|
| 1096 |
+
i(local) {
|
| 1097 |
+
if (current) return;
|
| 1098 |
+
transition_in(userblock.$$.fragment, local);
|
| 1099 |
+
current = true;
|
| 1100 |
+
},
|
| 1101 |
+
o(local) {
|
| 1102 |
+
transition_out(userblock.$$.fragment, local);
|
| 1103 |
+
current = false;
|
| 1104 |
+
},
|
| 1105 |
+
d(detaching) {
|
| 1106 |
+
destroy_component(userblock, detaching);
|
| 1107 |
+
}
|
| 1108 |
+
};
|
| 1109 |
+
}
|
| 1110 |
+
|
| 1111 |
+
// (28:47)
|
| 1112 |
+
function create_if_block_5(ctx) {
|
| 1113 |
+
let assistantblock;
|
| 1114 |
+
let current;
|
| 1115 |
+
|
| 1116 |
+
assistantblock = new AssistantBlock({
|
| 1117 |
+
props: { input: /*item*/ ctx[6]["content"] }
|
| 1118 |
+
});
|
| 1119 |
+
|
| 1120 |
+
return {
|
| 1121 |
+
c() {
|
| 1122 |
+
create_component(assistantblock.$$.fragment);
|
| 1123 |
+
},
|
| 1124 |
+
l(nodes) {
|
| 1125 |
+
claim_component(assistantblock.$$.fragment, nodes);
|
| 1126 |
+
},
|
| 1127 |
+
m(target, anchor) {
|
| 1128 |
+
mount_component(assistantblock, target, anchor);
|
| 1129 |
+
current = true;
|
| 1130 |
+
},
|
| 1131 |
+
p(ctx, dirty) {
|
| 1132 |
+
const assistantblock_changes = {};
|
| 1133 |
+
if (dirty & /*entry, dataColumn*/ 9) assistantblock_changes.input = /*item*/ ctx[6]["content"];
|
| 1134 |
+
assistantblock.$set(assistantblock_changes);
|
| 1135 |
+
},
|
| 1136 |
+
i(local) {
|
| 1137 |
+
if (current) return;
|
| 1138 |
+
transition_in(assistantblock.$$.fragment, local);
|
| 1139 |
+
current = true;
|
| 1140 |
+
},
|
| 1141 |
+
o(local) {
|
| 1142 |
+
transition_out(assistantblock.$$.fragment, local);
|
| 1143 |
+
current = false;
|
| 1144 |
+
},
|
| 1145 |
+
d(detaching) {
|
| 1146 |
+
destroy_component(assistantblock, detaching);
|
| 1147 |
+
}
|
| 1148 |
+
};
|
| 1149 |
+
}
|
| 1150 |
+
|
| 1151 |
+
// (26:8) {#if item["role"] === "system"}
|
| 1152 |
+
function create_if_block_4(ctx) {
|
| 1153 |
+
let systemblock;
|
| 1154 |
+
let current;
|
| 1155 |
+
|
| 1156 |
+
systemblock = new SystemBlock({
|
| 1157 |
+
props: { input: /*item*/ ctx[6]["content"] }
|
| 1158 |
+
});
|
| 1159 |
+
|
| 1160 |
+
return {
|
| 1161 |
+
c() {
|
| 1162 |
+
create_component(systemblock.$$.fragment);
|
| 1163 |
+
},
|
| 1164 |
+
l(nodes) {
|
| 1165 |
+
claim_component(systemblock.$$.fragment, nodes);
|
| 1166 |
+
},
|
| 1167 |
+
m(target, anchor) {
|
| 1168 |
+
mount_component(systemblock, target, anchor);
|
| 1169 |
+
current = true;
|
| 1170 |
+
},
|
| 1171 |
+
p(ctx, dirty) {
|
| 1172 |
+
const systemblock_changes = {};
|
| 1173 |
+
if (dirty & /*entry, dataColumn*/ 9) systemblock_changes.input = /*item*/ ctx[6]["content"];
|
| 1174 |
+
systemblock.$set(systemblock_changes);
|
| 1175 |
+
},
|
| 1176 |
+
i(local) {
|
| 1177 |
+
if (current) return;
|
| 1178 |
+
transition_in(systemblock.$$.fragment, local);
|
| 1179 |
+
current = true;
|
| 1180 |
+
},
|
| 1181 |
+
o(local) {
|
| 1182 |
+
transition_out(systemblock.$$.fragment, local);
|
| 1183 |
+
current = false;
|
| 1184 |
+
},
|
| 1185 |
+
d(detaching) {
|
| 1186 |
+
destroy_component(systemblock, detaching);
|
| 1187 |
+
}
|
| 1188 |
+
};
|
| 1189 |
+
}
|
| 1190 |
+
|
| 1191 |
+
// (25:6) {#each entry[dataColumn] as item}
|
| 1192 |
+
function create_each_block(ctx) {
|
| 1193 |
+
let current_block_type_index;
|
| 1194 |
+
let if_block;
|
| 1195 |
+
let if_block_anchor;
|
| 1196 |
+
let current;
|
| 1197 |
+
const if_block_creators = [create_if_block_4, create_if_block_5, create_if_block_6];
|
| 1198 |
+
const if_blocks = [];
|
| 1199 |
+
|
| 1200 |
+
function select_block_type_1(ctx, dirty) {
|
| 1201 |
+
if (/*item*/ ctx[6]["role"] === "system") return 0;
|
| 1202 |
+
if (/*item*/ ctx[6]["role"] === "assistant") return 1;
|
| 1203 |
+
if (/*item*/ ctx[6]["role"] === "user") return 2;
|
| 1204 |
+
return -1;
|
| 1205 |
+
}
|
| 1206 |
+
|
| 1207 |
+
if (~(current_block_type_index = select_block_type_1(ctx))) {
|
| 1208 |
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
| 1209 |
+
}
|
| 1210 |
+
|
| 1211 |
+
return {
|
| 1212 |
+
c() {
|
| 1213 |
+
if (if_block) if_block.c();
|
| 1214 |
+
if_block_anchor = empty();
|
| 1215 |
+
},
|
| 1216 |
+
l(nodes) {
|
| 1217 |
+
if (if_block) if_block.l(nodes);
|
| 1218 |
+
if_block_anchor = empty();
|
| 1219 |
+
},
|
| 1220 |
+
m(target, anchor) {
|
| 1221 |
+
if (~current_block_type_index) {
|
| 1222 |
+
if_blocks[current_block_type_index].m(target, anchor);
|
| 1223 |
+
}
|
| 1224 |
+
|
| 1225 |
+
insert_hydration(target, if_block_anchor, anchor);
|
| 1226 |
+
current = true;
|
| 1227 |
+
},
|
| 1228 |
+
p(ctx, dirty) {
|
| 1229 |
+
let previous_block_index = current_block_type_index;
|
| 1230 |
+
current_block_type_index = select_block_type_1(ctx);
|
| 1231 |
+
|
| 1232 |
+
if (current_block_type_index === previous_block_index) {
|
| 1233 |
+
if (~current_block_type_index) {
|
| 1234 |
+
if_blocks[current_block_type_index].p(ctx, dirty);
|
| 1235 |
+
}
|
| 1236 |
+
} else {
|
| 1237 |
+
if (if_block) {
|
| 1238 |
+
group_outros();
|
| 1239 |
+
|
| 1240 |
+
transition_out(if_blocks[previous_block_index], 1, 1, () => {
|
| 1241 |
+
if_blocks[previous_block_index] = null;
|
| 1242 |
+
});
|
| 1243 |
+
|
| 1244 |
+
check_outros();
|
| 1245 |
+
}
|
| 1246 |
+
|
| 1247 |
+
if (~current_block_type_index) {
|
| 1248 |
+
if_block = if_blocks[current_block_type_index];
|
| 1249 |
+
|
| 1250 |
+
if (!if_block) {
|
| 1251 |
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
| 1252 |
+
if_block.c();
|
| 1253 |
+
} else {
|
| 1254 |
+
if_block.p(ctx, dirty);
|
| 1255 |
+
}
|
| 1256 |
+
|
| 1257 |
+
transition_in(if_block, 1);
|
| 1258 |
+
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
| 1259 |
+
} else {
|
| 1260 |
+
if_block = null;
|
| 1261 |
+
}
|
| 1262 |
+
}
|
| 1263 |
+
},
|
| 1264 |
+
i(local) {
|
| 1265 |
+
if (current) return;
|
| 1266 |
+
transition_in(if_block);
|
| 1267 |
+
current = true;
|
| 1268 |
+
},
|
| 1269 |
+
o(local) {
|
| 1270 |
+
transition_out(if_block);
|
| 1271 |
+
current = false;
|
| 1272 |
+
},
|
| 1273 |
+
d(detaching) {
|
| 1274 |
+
if (~current_block_type_index) {
|
| 1275 |
+
if_blocks[current_block_type_index].d(detaching);
|
| 1276 |
+
}
|
| 1277 |
+
|
| 1278 |
+
if (detaching) detach(if_block_anchor);
|
| 1279 |
+
}
|
| 1280 |
+
};
|
| 1281 |
+
}
|
| 1282 |
+
|
| 1283 |
+
// (36:2) {#if entry[modelColumn]}
|
| 1284 |
+
function create_if_block_1(ctx) {
|
| 1285 |
+
let assistantblock;
|
| 1286 |
+
let current;
|
| 1287 |
+
|
| 1288 |
+
assistantblock = new AssistantBlock({
|
| 1289 |
+
props: {
|
| 1290 |
+
input: /*entry*/ ctx[0][/*modelColumn*/ ctx[1]],
|
| 1291 |
+
output: true
|
| 1292 |
+
}
|
| 1293 |
+
});
|
| 1294 |
+
|
| 1295 |
+
return {
|
| 1296 |
+
c() {
|
| 1297 |
+
create_component(assistantblock.$$.fragment);
|
| 1298 |
+
},
|
| 1299 |
+
l(nodes) {
|
| 1300 |
+
claim_component(assistantblock.$$.fragment, nodes);
|
| 1301 |
+
},
|
| 1302 |
+
m(target, anchor) {
|
| 1303 |
+
mount_component(assistantblock, target, anchor);
|
| 1304 |
+
current = true;
|
| 1305 |
+
},
|
| 1306 |
+
p(ctx, dirty) {
|
| 1307 |
+
const assistantblock_changes = {};
|
| 1308 |
+
if (dirty & /*entry, modelColumn*/ 3) assistantblock_changes.input = /*entry*/ ctx[0][/*modelColumn*/ ctx[1]];
|
| 1309 |
+
assistantblock.$set(assistantblock_changes);
|
| 1310 |
+
},
|
| 1311 |
+
i(local) {
|
| 1312 |
+
if (current) return;
|
| 1313 |
+
transition_in(assistantblock.$$.fragment, local);
|
| 1314 |
+
current = true;
|
| 1315 |
+
},
|
| 1316 |
+
o(local) {
|
| 1317 |
+
transition_out(assistantblock.$$.fragment, local);
|
| 1318 |
+
current = false;
|
| 1319 |
+
},
|
| 1320 |
+
d(detaching) {
|
| 1321 |
+
destroy_component(assistantblock, detaching);
|
| 1322 |
+
}
|
| 1323 |
+
};
|
| 1324 |
+
}
|
| 1325 |
+
|
| 1326 |
+
// (39:2) {#if entry[labelColumn]}
|
| 1327 |
+
function create_if_block(ctx) {
|
| 1328 |
+
let p;
|
| 1329 |
+
let span;
|
| 1330 |
+
let t0;
|
| 1331 |
+
let t1;
|
| 1332 |
+
let t2_value = /*entry*/ ctx[0][/*labelColumn*/ ctx[2]] + "";
|
| 1333 |
+
let t2;
|
| 1334 |
+
|
| 1335 |
+
return {
|
| 1336 |
+
c() {
|
| 1337 |
+
p = element("p");
|
| 1338 |
+
span = element("span");
|
| 1339 |
+
t0 = text("Expected:");
|
| 1340 |
+
t1 = space();
|
| 1341 |
+
t2 = text(t2_value);
|
| 1342 |
+
this.h();
|
| 1343 |
+
},
|
| 1344 |
+
l(nodes) {
|
| 1345 |
+
p = claim_element(nodes, "P", { class: true });
|
| 1346 |
+
var p_nodes = children(p);
|
| 1347 |
+
span = claim_element(p_nodes, "SPAN", { class: true });
|
| 1348 |
+
var span_nodes = children(span);
|
| 1349 |
+
t0 = claim_text(span_nodes, "Expected:");
|
| 1350 |
+
span_nodes.forEach(detach);
|
| 1351 |
+
t1 = claim_space(p_nodes);
|
| 1352 |
+
t2 = claim_text(p_nodes, t2_value);
|
| 1353 |
+
p_nodes.forEach(detach);
|
| 1354 |
+
this.h();
|
| 1355 |
+
},
|
| 1356 |
+
h() {
|
| 1357 |
+
attr(span, "class", "label svelte-eoma5v");
|
| 1358 |
+
attr(p, "class", "svelte-eoma5v");
|
| 1359 |
+
},
|
| 1360 |
+
m(target, anchor) {
|
| 1361 |
+
insert_hydration(target, p, anchor);
|
| 1362 |
+
append_hydration(p, span);
|
| 1363 |
+
append_hydration(span, t0);
|
| 1364 |
+
append_hydration(p, t1);
|
| 1365 |
+
append_hydration(p, t2);
|
| 1366 |
+
},
|
| 1367 |
+
p(ctx, dirty) {
|
| 1368 |
+
if (dirty & /*entry, labelColumn*/ 5 && t2_value !== (t2_value = /*entry*/ ctx[0][/*labelColumn*/ ctx[2]] + "")) set_data(t2, t2_value);
|
| 1369 |
+
},
|
| 1370 |
+
d(detaching) {
|
| 1371 |
+
if (detaching) detach(p);
|
| 1372 |
+
}
|
| 1373 |
+
};
|
| 1374 |
+
}
|
| 1375 |
+
|
| 1376 |
+
function create_fragment(ctx) {
|
| 1377 |
+
let div;
|
| 1378 |
+
let t0;
|
| 1379 |
+
let t1;
|
| 1380 |
+
let current;
|
| 1381 |
+
let if_block0 = /*entry*/ ctx[0][/*dataColumn*/ ctx[3]] && create_if_block_2(ctx);
|
| 1382 |
+
let if_block1 = /*entry*/ ctx[0][/*modelColumn*/ ctx[1]] && create_if_block_1(ctx);
|
| 1383 |
+
let if_block2 = /*entry*/ ctx[0][/*labelColumn*/ ctx[2]] && create_if_block(ctx);
|
| 1384 |
+
|
| 1385 |
+
return {
|
| 1386 |
+
c() {
|
| 1387 |
+
div = element("div");
|
| 1388 |
+
if (if_block0) if_block0.c();
|
| 1389 |
+
t0 = space();
|
| 1390 |
+
if (if_block1) if_block1.c();
|
| 1391 |
+
t1 = space();
|
| 1392 |
+
if (if_block2) if_block2.c();
|
| 1393 |
+
this.h();
|
| 1394 |
+
},
|
| 1395 |
+
l(nodes) {
|
| 1396 |
+
div = claim_element(nodes, "DIV", { id: true, class: true });
|
| 1397 |
+
var div_nodes = children(div);
|
| 1398 |
+
if (if_block0) if_block0.l(div_nodes);
|
| 1399 |
+
t0 = claim_space(div_nodes);
|
| 1400 |
+
if (if_block1) if_block1.l(div_nodes);
|
| 1401 |
+
t1 = claim_space(div_nodes);
|
| 1402 |
+
if (if_block2) if_block2.l(div_nodes);
|
| 1403 |
+
div_nodes.forEach(detach);
|
| 1404 |
+
this.h();
|
| 1405 |
+
},
|
| 1406 |
+
h() {
|
| 1407 |
+
attr(div, "id", "container");
|
| 1408 |
+
attr(div, "class", "svelte-eoma5v");
|
| 1409 |
+
},
|
| 1410 |
+
m(target, anchor) {
|
| 1411 |
+
insert_hydration(target, div, anchor);
|
| 1412 |
+
if (if_block0) if_block0.m(div, null);
|
| 1413 |
+
append_hydration(div, t0);
|
| 1414 |
+
if (if_block1) if_block1.m(div, null);
|
| 1415 |
+
append_hydration(div, t1);
|
| 1416 |
+
if (if_block2) if_block2.m(div, null);
|
| 1417 |
+
current = true;
|
| 1418 |
+
},
|
| 1419 |
+
p(ctx, [dirty]) {
|
| 1420 |
+
if (/*entry*/ ctx[0][/*dataColumn*/ ctx[3]]) {
|
| 1421 |
+
if (if_block0) {
|
| 1422 |
+
if_block0.p(ctx, dirty);
|
| 1423 |
+
|
| 1424 |
+
if (dirty & /*entry, dataColumn*/ 9) {
|
| 1425 |
+
transition_in(if_block0, 1);
|
| 1426 |
+
}
|
| 1427 |
+
} else {
|
| 1428 |
+
if_block0 = create_if_block_2(ctx);
|
| 1429 |
+
if_block0.c();
|
| 1430 |
+
transition_in(if_block0, 1);
|
| 1431 |
+
if_block0.m(div, t0);
|
| 1432 |
+
}
|
| 1433 |
+
} else if (if_block0) {
|
| 1434 |
+
group_outros();
|
| 1435 |
+
|
| 1436 |
+
transition_out(if_block0, 1, 1, () => {
|
| 1437 |
+
if_block0 = null;
|
| 1438 |
+
});
|
| 1439 |
+
|
| 1440 |
+
check_outros();
|
| 1441 |
+
}
|
| 1442 |
+
|
| 1443 |
+
if (/*entry*/ ctx[0][/*modelColumn*/ ctx[1]]) {
|
| 1444 |
+
if (if_block1) {
|
| 1445 |
+
if_block1.p(ctx, dirty);
|
| 1446 |
+
|
| 1447 |
+
if (dirty & /*entry, modelColumn*/ 3) {
|
| 1448 |
+
transition_in(if_block1, 1);
|
| 1449 |
+
}
|
| 1450 |
+
} else {
|
| 1451 |
+
if_block1 = create_if_block_1(ctx);
|
| 1452 |
+
if_block1.c();
|
| 1453 |
+
transition_in(if_block1, 1);
|
| 1454 |
+
if_block1.m(div, t1);
|
| 1455 |
+
}
|
| 1456 |
+
} else if (if_block1) {
|
| 1457 |
+
group_outros();
|
| 1458 |
+
|
| 1459 |
+
transition_out(if_block1, 1, 1, () => {
|
| 1460 |
+
if_block1 = null;
|
| 1461 |
+
});
|
| 1462 |
+
|
| 1463 |
+
check_outros();
|
| 1464 |
+
}
|
| 1465 |
+
|
| 1466 |
+
if (/*entry*/ ctx[0][/*labelColumn*/ ctx[2]]) {
|
| 1467 |
+
if (if_block2) {
|
| 1468 |
+
if_block2.p(ctx, dirty);
|
| 1469 |
+
} else {
|
| 1470 |
+
if_block2 = create_if_block(ctx);
|
| 1471 |
+
if_block2.c();
|
| 1472 |
+
if_block2.m(div, null);
|
| 1473 |
+
}
|
| 1474 |
+
} else if (if_block2) {
|
| 1475 |
+
if_block2.d(1);
|
| 1476 |
+
if_block2 = null;
|
| 1477 |
+
}
|
| 1478 |
+
},
|
| 1479 |
+
i(local) {
|
| 1480 |
+
if (current) return;
|
| 1481 |
+
transition_in(if_block0);
|
| 1482 |
+
transition_in(if_block1);
|
| 1483 |
+
current = true;
|
| 1484 |
+
},
|
| 1485 |
+
o(local) {
|
| 1486 |
+
transition_out(if_block0);
|
| 1487 |
+
transition_out(if_block1);
|
| 1488 |
+
current = false;
|
| 1489 |
+
},
|
| 1490 |
+
d(detaching) {
|
| 1491 |
+
if (detaching) detach(div);
|
| 1492 |
+
if (if_block0) if_block0.d();
|
| 1493 |
+
if (if_block1) if_block1.d();
|
| 1494 |
+
if (if_block2) if_block2.d();
|
| 1495 |
+
}
|
| 1496 |
+
};
|
| 1497 |
+
}
|
| 1498 |
+
|
| 1499 |
+
function instance($$self, $$props, $$invalidate) {
|
| 1500 |
+
let { options } = $$props;
|
| 1501 |
+
let { entry } = $$props;
|
| 1502 |
+
let { modelColumn } = $$props;
|
| 1503 |
+
let { labelColumn } = $$props;
|
| 1504 |
+
let { dataColumn } = $$props;
|
| 1505 |
+
let { idColumn } = $$props;
|
| 1506 |
+
|
| 1507 |
+
$$self.$$set = $$props => {
|
| 1508 |
+
if ('options' in $$props) $$invalidate(4, options = $$props.options);
|
| 1509 |
+
if ('entry' in $$props) $$invalidate(0, entry = $$props.entry);
|
| 1510 |
+
if ('modelColumn' in $$props) $$invalidate(1, modelColumn = $$props.modelColumn);
|
| 1511 |
+
if ('labelColumn' in $$props) $$invalidate(2, labelColumn = $$props.labelColumn);
|
| 1512 |
+
if ('dataColumn' in $$props) $$invalidate(3, dataColumn = $$props.dataColumn);
|
| 1513 |
+
if ('idColumn' in $$props) $$invalidate(5, idColumn = $$props.idColumn);
|
| 1514 |
+
};
|
| 1515 |
+
|
| 1516 |
+
return [entry, modelColumn, labelColumn, dataColumn, options, idColumn];
|
| 1517 |
+
}
|
| 1518 |
+
|
| 1519 |
+
class InstanceView extends SvelteComponent {
|
| 1520 |
+
constructor(options) {
|
| 1521 |
+
super();
|
| 1522 |
+
|
| 1523 |
+
init(
|
| 1524 |
+
this,
|
| 1525 |
+
options,
|
| 1526 |
+
instance,
|
| 1527 |
+
create_fragment,
|
| 1528 |
+
safe_not_equal,
|
| 1529 |
+
{
|
| 1530 |
+
options: 4,
|
| 1531 |
+
entry: 0,
|
| 1532 |
+
modelColumn: 1,
|
| 1533 |
+
labelColumn: 2,
|
| 1534 |
+
dataColumn: 3,
|
| 1535 |
+
idColumn: 5
|
| 1536 |
+
},
|
| 1537 |
+
add_css
|
| 1538 |
+
);
|
| 1539 |
+
}
|
| 1540 |
+
}
|
| 1541 |
+
|
| 1542 |
+
function getInstance(
|
| 1543 |
+
div,
|
| 1544 |
+
viewOptions,
|
| 1545 |
+
entry,
|
| 1546 |
+
modelColumn,
|
| 1547 |
+
labelColumn,
|
| 1548 |
+
dataColumn,
|
| 1549 |
+
idColumn
|
| 1550 |
+
) {
|
| 1551 |
+
new InstanceView({
|
| 1552 |
+
target: div,
|
| 1553 |
+
props: {
|
| 1554 |
+
entry: entry,
|
| 1555 |
+
viewOptions: viewOptions,
|
| 1556 |
+
modelColumn: modelColumn,
|
| 1557 |
+
labelColumn: labelColumn,
|
| 1558 |
+
dataColumn: dataColumn,
|
| 1559 |
+
idColumn: idColumn,
|
| 1560 |
+
},
|
| 1561 |
+
hydrate: true,
|
| 1562 |
+
});
|
| 1563 |
+
}
|
| 1564 |
+
|
| 1565 |
+
// export function getOptions(div, setOptions) {
|
| 1566 |
+
// new OptionsView({
|
| 1567 |
+
// target: div,
|
| 1568 |
+
// props: {
|
| 1569 |
+
// setOptions,
|
| 1570 |
+
// },
|
| 1571 |
+
// });
|
| 1572 |
+
// }
|
| 1573 |
+
|
| 1574 |
+
export { getInstance };
|
evals/evals.yaml
CHANGED
|
@@ -5,4 +5,5 @@
|
|
| 5 |
- emotional-intelligence:
|
| 6 |
results-file: ./crossword/crossword-turbo.jsonl
|
| 7 |
second-results-file: ./crossword/crossword-turbo-0301.jsonl
|
| 8 |
-
|
|
|
|
|
|
| 5 |
- emotional-intelligence:
|
| 6 |
results-file: ./crossword/crossword-turbo.jsonl
|
| 7 |
second-results-file: ./crossword/crossword-turbo-0301.jsonl
|
| 8 |
+
- crossword-only-result:
|
| 9 |
+
results-file: ./crossword/crossword-turbo.jsonl
|
frontend/package-lock.json
CHANGED
|
@@ -8,9 +8,11 @@
|
|
| 8 |
"name": "zeno-evals-hub",
|
| 9 |
"version": "0.0.0",
|
| 10 |
"dependencies": {
|
| 11 |
-
"@material/dom": "^14.0.0"
|
|
|
|
| 12 |
},
|
| 13 |
"devDependencies": {
|
|
|
|
| 14 |
"@smui/data-table": "^7.0.0-beta.3",
|
| 15 |
"@sveltejs/vite-plugin-svelte": "^2.0.3",
|
| 16 |
"@tsconfig/svelte": "^3.0.0",
|
|
@@ -538,6 +540,27 @@
|
|
| 538 |
"tslib": "^2.1.0"
|
| 539 |
}
|
| 540 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 541 |
"node_modules/@material/checkbox": {
|
| 542 |
"version": "14.0.0",
|
| 543 |
"resolved": "https://registry.npmjs.org/@material/checkbox/-/checkbox-14.0.0.tgz",
|
|
@@ -879,6 +902,11 @@
|
|
| 879 |
"tslib": "^2.1.0"
|
| 880 |
}
|
| 881 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 882 |
"node_modules/@nodelib/fs.scandir": {
|
| 883 |
"version": "2.1.5",
|
| 884 |
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
|
@@ -914,6 +942,23 @@
|
|
| 914 |
"node": ">= 8"
|
| 915 |
}
|
| 916 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 917 |
"node_modules/@smui/checkbox": {
|
| 918 |
"version": "7.0.0-beta.3",
|
| 919 |
"resolved": "https://registry.npmjs.org/@smui/checkbox/-/checkbox-7.0.0-beta.3.tgz",
|
|
|
|
| 8 |
"name": "zeno-evals-hub",
|
| 9 |
"version": "0.0.0",
|
| 10 |
"dependencies": {
|
| 11 |
+
"@material/dom": "^14.0.0",
|
| 12 |
+
"@mdi/js": "^7.2.96"
|
| 13 |
},
|
| 14 |
"devDependencies": {
|
| 15 |
+
"@smui/button": "^7.0.0-beta.3",
|
| 16 |
"@smui/data-table": "^7.0.0-beta.3",
|
| 17 |
"@sveltejs/vite-plugin-svelte": "^2.0.3",
|
| 18 |
"@tsconfig/svelte": "^3.0.0",
|
|
|
|
| 540 |
"tslib": "^2.1.0"
|
| 541 |
}
|
| 542 |
},
|
| 543 |
+
"node_modules/@material/button": {
|
| 544 |
+
"version": "14.0.0",
|
| 545 |
+
"resolved": "https://registry.npmjs.org/@material/button/-/button-14.0.0.tgz",
|
| 546 |
+
"integrity": "sha512-dqqHaJq0peyXBZupFzCjmvScrfljyVU66ZCS3oldsaaj5iz8sn33I/45Z4zPzdR5F5z8ExToHkRcXhakj1UEAA==",
|
| 547 |
+
"dev": true,
|
| 548 |
+
"dependencies": {
|
| 549 |
+
"@material/density": "^14.0.0",
|
| 550 |
+
"@material/dom": "^14.0.0",
|
| 551 |
+
"@material/elevation": "^14.0.0",
|
| 552 |
+
"@material/feature-targeting": "^14.0.0",
|
| 553 |
+
"@material/focus-ring": "^14.0.0",
|
| 554 |
+
"@material/ripple": "^14.0.0",
|
| 555 |
+
"@material/rtl": "^14.0.0",
|
| 556 |
+
"@material/shape": "^14.0.0",
|
| 557 |
+
"@material/theme": "^14.0.0",
|
| 558 |
+
"@material/tokens": "^14.0.0",
|
| 559 |
+
"@material/touch-target": "^14.0.0",
|
| 560 |
+
"@material/typography": "^14.0.0",
|
| 561 |
+
"tslib": "^2.1.0"
|
| 562 |
+
}
|
| 563 |
+
},
|
| 564 |
"node_modules/@material/checkbox": {
|
| 565 |
"version": "14.0.0",
|
| 566 |
"resolved": "https://registry.npmjs.org/@material/checkbox/-/checkbox-14.0.0.tgz",
|
|
|
|
| 902 |
"tslib": "^2.1.0"
|
| 903 |
}
|
| 904 |
},
|
| 905 |
+
"node_modules/@mdi/js": {
|
| 906 |
+
"version": "7.2.96",
|
| 907 |
+
"resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.2.96.tgz",
|
| 908 |
+
"integrity": "sha512-paR9M9ZT7rKbh2boksNUynuSZMHhqRYnEZOm/KrZTjQ4/FzyhjLHuvw/8XYzP+E7fS4+/Ms/82EN1pl/OFsiIA=="
|
| 909 |
+
},
|
| 910 |
"node_modules/@nodelib/fs.scandir": {
|
| 911 |
"version": "2.1.5",
|
| 912 |
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
|
|
|
| 942 |
"node": ">= 8"
|
| 943 |
}
|
| 944 |
},
|
| 945 |
+
"node_modules/@smui/button": {
|
| 946 |
+
"version": "7.0.0-beta.3",
|
| 947 |
+
"resolved": "https://registry.npmjs.org/@smui/button/-/button-7.0.0-beta.3.tgz",
|
| 948 |
+
"integrity": "sha512-H8yKk+KElOwJTqkHBNA7+WXYV6dV7/g/VQEgNduQm+reZAmNYTfie6n/k7KpBTgpiIFZ7iepSGfFw4yBK7lfQg==",
|
| 949 |
+
"dev": true,
|
| 950 |
+
"dependencies": {
|
| 951 |
+
"@material/button": "^14.0.0",
|
| 952 |
+
"@material/elevation": "^14.0.0",
|
| 953 |
+
"@material/feature-targeting": "^14.0.0",
|
| 954 |
+
"@material/ripple": "^14.0.0",
|
| 955 |
+
"@material/shape": "^14.0.0",
|
| 956 |
+
"@material/theme": "^14.0.0",
|
| 957 |
+
"@smui/common": "^7.0.0-beta.3",
|
| 958 |
+
"@smui/ripple": "^7.0.0-beta.3",
|
| 959 |
+
"svelte2tsx": "^0.6.10"
|
| 960 |
+
}
|
| 961 |
+
},
|
| 962 |
"node_modules/@smui/checkbox": {
|
| 963 |
"version": "7.0.0-beta.3",
|
| 964 |
"resolved": "https://registry.npmjs.org/@smui/checkbox/-/checkbox-7.0.0-beta.3.tgz",
|
frontend/package.json
CHANGED
|
@@ -14,6 +14,7 @@
|
|
| 14 |
"generate-api": "openapi --input http://localhost:8000/api/openapi.json --output ./src/zeno-evals-hubservice --client fetch; npx prettier -w ./src/zeno-evals-hubservice"
|
| 15 |
},
|
| 16 |
"devDependencies": {
|
|
|
|
| 17 |
"@smui/data-table": "^7.0.0-beta.3",
|
| 18 |
"@sveltejs/vite-plugin-svelte": "^2.0.3",
|
| 19 |
"@tsconfig/svelte": "^3.0.0",
|
|
@@ -28,6 +29,7 @@
|
|
| 28 |
"vite": "^4.2.0"
|
| 29 |
},
|
| 30 |
"dependencies": {
|
| 31 |
-
"@material/dom": "^14.0.0"
|
|
|
|
| 32 |
}
|
| 33 |
}
|
|
|
|
| 14 |
"generate-api": "openapi --input http://localhost:8000/api/openapi.json --output ./src/zeno-evals-hubservice --client fetch; npx prettier -w ./src/zeno-evals-hubservice"
|
| 15 |
},
|
| 16 |
"devDependencies": {
|
| 17 |
+
"@smui/button": "^7.0.0-beta.3",
|
| 18 |
"@smui/data-table": "^7.0.0-beta.3",
|
| 19 |
"@sveltejs/vite-plugin-svelte": "^2.0.3",
|
| 20 |
"@tsconfig/svelte": "^3.0.0",
|
|
|
|
| 29 |
"vite": "^4.2.0"
|
| 30 |
},
|
| 31 |
"dependencies": {
|
| 32 |
+
"@material/dom": "^14.0.0",
|
| 33 |
+
"@mdi/js": "^7.2.96"
|
| 34 |
}
|
| 35 |
}
|
frontend/public/openai.svg
ADDED
|
|
frontend/public/smui.css
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
frontend/public/vite.svg
DELETED
frontend/src/App.svelte
CHANGED
|
@@ -1,51 +1,67 @@
|
|
| 1 |
<script lang="ts">
|
|
|
|
|
|
|
| 2 |
let data = fetch("/args").then((d) => d.json());
|
|
|
|
|
|
|
|
|
|
| 3 |
</script>
|
| 4 |
|
| 5 |
<main>
|
| 6 |
-
<h1>
|
| 7 |
-
|
| 8 |
-
|
| 9 |
<a href="https://zenoml.com">Zeno</a>
|
| 10 |
-
</
|
|
|
|
| 11 |
<!-- table with links to zeno sites. -->
|
| 12 |
<div id="container">
|
| 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 |
</div>
|
| 50 |
</main>
|
| 51 |
|
|
@@ -55,19 +71,56 @@
|
|
| 55 |
display: flex;
|
| 56 |
justify-content: center;
|
| 57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
table {
|
| 59 |
border-collapse: collapse;
|
| 60 |
text-align: left;
|
|
|
|
|
|
|
|
|
|
| 61 |
}
|
| 62 |
table thead tr th {
|
| 63 |
border-bottom: 0.5px solid grey;
|
| 64 |
}
|
| 65 |
table th,
|
| 66 |
table td {
|
| 67 |
-
|
| 68 |
}
|
| 69 |
-
table
|
| 70 |
-
table
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
| 73 |
</style>
|
|
|
|
| 1 |
<script lang="ts">
|
| 2 |
+
import Button, { Label, Icon } from "@smui/button";
|
| 3 |
+
import Handshake from "./assets/handshake.svelte";
|
| 4 |
let data = fetch("/args").then((d) => d.json());
|
| 5 |
+
let blur = function (ev) {
|
| 6 |
+
ev.target.blur();
|
| 7 |
+
};
|
| 8 |
</script>
|
| 9 |
|
| 10 |
<main>
|
| 11 |
+
<h1>
|
| 12 |
+
<a href="https://github.com/openai/evals">OpenAI</a>
|
| 13 |
+
<Handshake />
|
| 14 |
<a href="https://zenoml.com">Zeno</a>
|
| 15 |
+
</h1>
|
| 16 |
+
<h4>Explore the results of OpenAI evals all in one place...</h4>
|
| 17 |
<!-- table with links to zeno sites. -->
|
| 18 |
<div id="container">
|
| 19 |
+
<div id="table-background">
|
| 20 |
+
<table>
|
| 21 |
+
<thead>
|
| 22 |
+
<tr>
|
| 23 |
+
<th>Evaluation</th>
|
| 24 |
+
<th>Models</th>
|
| 25 |
+
<th>Accuracy</th>
|
| 26 |
+
<th>Events</th>
|
| 27 |
+
<th>Actions</th>
|
| 28 |
+
</tr>
|
| 29 |
+
</thead>
|
| 30 |
+
<tbody>
|
| 31 |
+
{#await data}
|
| 32 |
+
<p>loading</p>
|
| 33 |
+
{:then final_data}
|
| 34 |
+
{#each final_data as d}
|
| 35 |
+
{@const name = Object.keys(d)[0]}
|
| 36 |
+
<tr>
|
| 37 |
+
<td><div class="name-wrap">{name}</div> </td>
|
| 38 |
+
<td>
|
| 39 |
+
{#each d[name]["models"] as m}{m}<br />{/each}
|
| 40 |
+
</td>
|
| 41 |
+
<td>
|
| 42 |
+
{#each d[name]["accuracy"] as a}{a}%<br />{/each}
|
| 43 |
+
</td>
|
| 44 |
+
<td>
|
| 45 |
+
{#each d[name]["events"] as e}{e}<br />{/each}
|
| 46 |
+
</td>
|
| 47 |
+
<td>
|
| 48 |
+
<Button
|
| 49 |
+
on:mouseleave={blur}
|
| 50 |
+
on:focusout={blur}
|
| 51 |
+
href="/{name}/"
|
| 52 |
+
ripple={false}
|
| 53 |
+
class="button-shaped-round"
|
| 54 |
+
>
|
| 55 |
+
<Icon class="material-icons">rocket</Icon>
|
| 56 |
+
<Label>Launch</Label>
|
| 57 |
+
</Button>
|
| 58 |
+
</td>
|
| 59 |
+
</tr>
|
| 60 |
+
{/each}
|
| 61 |
+
{/await}
|
| 62 |
+
</tbody>
|
| 63 |
+
</table>
|
| 64 |
+
</div>
|
| 65 |
</div>
|
| 66 |
</main>
|
| 67 |
|
|
|
|
| 71 |
display: flex;
|
| 72 |
justify-content: center;
|
| 73 |
}
|
| 74 |
+
#table-background {
|
| 75 |
+
background-color: #dce3f6;
|
| 76 |
+
width: 800px;
|
| 77 |
+
padding: 20px;
|
| 78 |
+
border-radius: 20px;
|
| 79 |
+
}
|
| 80 |
+
.name-wrap {
|
| 81 |
+
border: 1px solid transparent;
|
| 82 |
+
padding: 5px 10px;
|
| 83 |
+
border-radius: 20px;
|
| 84 |
+
background-color: #646cff;
|
| 85 |
+
color: white;
|
| 86 |
+
}
|
| 87 |
table {
|
| 88 |
border-collapse: collapse;
|
| 89 |
text-align: left;
|
| 90 |
+
cursor: default;
|
| 91 |
+
margin-left: auto;
|
| 92 |
+
margin-right: auto;
|
| 93 |
}
|
| 94 |
table thead tr th {
|
| 95 |
border-bottom: 0.5px solid grey;
|
| 96 |
}
|
| 97 |
table th,
|
| 98 |
table td {
|
| 99 |
+
padding: 4px 25px;
|
| 100 |
}
|
| 101 |
+
table td:first-child,
|
| 102 |
+
table th:first-child {
|
| 103 |
+
border-radius: 20px 0 0 20px;
|
| 104 |
+
}
|
| 105 |
+
table td:last-child,
|
| 106 |
+
table th:last-child {
|
| 107 |
+
border-radius: 0 20px 20px 0;
|
| 108 |
+
}
|
| 109 |
+
tbody:before {
|
| 110 |
+
content: "@";
|
| 111 |
+
display: block;
|
| 112 |
+
line-height: 10px;
|
| 113 |
+
text-indent: -99999px;
|
| 114 |
+
}
|
| 115 |
+
thead tr {
|
| 116 |
+
color: #213547;
|
| 117 |
+
}
|
| 118 |
+
tbody tr {
|
| 119 |
+
opacity: 0.9;
|
| 120 |
+
height: 64px;
|
| 121 |
+
}
|
| 122 |
+
tbody tr:hover {
|
| 123 |
+
opacity: 1;
|
| 124 |
+
background-color: #ededed;
|
| 125 |
}
|
| 126 |
</style>
|
frontend/src/assets/handshake.svelte
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
| 2 |
+
<svg
|
| 3 |
+
width="30px"
|
| 4 |
+
height="30px"
|
| 5 |
+
viewBox="0 0 48 48"
|
| 6 |
+
xmlns="http://www.w3.org/2000/svg"
|
| 7 |
+
>
|
| 8 |
+
<g id="Layer_2" data-name="Layer 2">
|
| 9 |
+
<g id="invisible_box" data-name="invisible box">
|
| 10 |
+
<rect width="48" height="48" fill="none" />
|
| 11 |
+
</g>
|
| 12 |
+
<g id="Health_Icons" data-name="Health Icons">
|
| 13 |
+
<g>
|
| 14 |
+
<path
|
| 15 |
+
d="M44,30H42.8L26.4,13.6a1.9,1.9,0,0,0-2.8,0l-5.9,5.9a1,1,0,0,1-1.4,0L14.8,18l1.6-1.6h0L25,7.8l8.6,8.6A2,2,0,0,0,35,17h9a2,2,0,0,0,0-4H35.8L26.4,3.6a1.9,1.9,0,0,0-2.8,0L14.2,13H4a2,2,0,0,0,0,4h6.6a2.8,2.8,0,0,0,.7,3.1l2.2,2.2a5,5,0,0,0,7,0L25,17.8,40.6,33.4A2,2,0,0,0,42,34h2a2,2,0,0,0,0-4Z"
|
| 16 |
+
/>
|
| 17 |
+
<path
|
| 18 |
+
d="M31.4,27.6a2,2,0,0,0-2.8,2.8l7,7a1.9,1.9,0,0,0,2.8,0,1.9,1.9,0,0,0,0-2.8Z"
|
| 19 |
+
/>
|
| 20 |
+
<path
|
| 21 |
+
d="M25.4,30.6a2,2,0,0,0-2.8,2.8l7,7a1.9,1.9,0,0,0,2.8,0,1.9,1.9,0,0,0,0-2.8Z"
|
| 22 |
+
/>
|
| 23 |
+
<path
|
| 24 |
+
d="M18.4,32.6a2,2,0,0,0-2.8,2.8l7,7a1.9,1.9,0,0,0,2.8,0,1.9,1.9,0,0,0,0-2.8Z"
|
| 25 |
+
/>
|
| 26 |
+
<path
|
| 27 |
+
d="M7.4,30.6A2,2,0,0,0,6,30H4a2,2,0,0,0,0,4H5.2L15.6,44.4a1.9,1.9,0,0,0,2.8,0,1.9,1.9,0,0,0,0-2.8Z"
|
| 28 |
+
/>
|
| 29 |
+
</g>
|
| 30 |
+
</g>
|
| 31 |
+
</g>
|
| 32 |
+
</svg>
|
frontend/src/assets/svelte.svg
DELETED
frontend/src/theme/_smui-theme.scss
CHANGED
|
@@ -11,6 +11,12 @@
|
|
| 11 |
$error: color-palette.$red-900
|
| 12 |
);
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
:root {
|
| 15 |
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
| 16 |
line-height: 1.5;
|
|
@@ -28,12 +34,11 @@
|
|
| 28 |
}
|
| 29 |
|
| 30 |
a {
|
| 31 |
-
|
| 32 |
-
color: #646cff;
|
| 33 |
text-decoration: inherit;
|
| 34 |
}
|
| 35 |
a:hover {
|
| 36 |
-
color: #
|
| 37 |
}
|
| 38 |
|
| 39 |
h1 {
|
|
@@ -48,25 +53,6 @@ h1 {
|
|
| 48 |
#app {
|
| 49 |
max-width: 1280px;
|
| 50 |
margin: 0 auto;
|
| 51 |
-
padding:
|
| 52 |
text-align: center;
|
| 53 |
}
|
| 54 |
-
|
| 55 |
-
button {
|
| 56 |
-
border-radius: 8px;
|
| 57 |
-
border: 1px solid transparent;
|
| 58 |
-
padding: 0.6em 1.2em;
|
| 59 |
-
font-size: 1em;
|
| 60 |
-
font-weight: 500;
|
| 61 |
-
font-family: inherit;
|
| 62 |
-
background-color: #f9f9f9;
|
| 63 |
-
cursor: pointer;
|
| 64 |
-
transition: border-color 0.25s;
|
| 65 |
-
}
|
| 66 |
-
button:hover {
|
| 67 |
-
border-color: #646cff;
|
| 68 |
-
}
|
| 69 |
-
button:focus,
|
| 70 |
-
button:focus-visible {
|
| 71 |
-
outline: 4px auto -webkit-focus-ring-color;
|
| 72 |
-
}
|
|
|
|
| 11 |
$error: color-palette.$red-900
|
| 12 |
);
|
| 13 |
|
| 14 |
+
@use "@material/button/mixins" as mdc-button;
|
| 15 |
+
|
| 16 |
+
.button-shaped-round {
|
| 17 |
+
@include mdc-button.shape-radius(100%);
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
:root {
|
| 21 |
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
| 22 |
line-height: 1.5;
|
|
|
|
| 34 |
}
|
| 35 |
|
| 36 |
a {
|
| 37 |
+
color: #213547;
|
|
|
|
| 38 |
text-decoration: inherit;
|
| 39 |
}
|
| 40 |
a:hover {
|
| 41 |
+
color: #646cff;
|
| 42 |
}
|
| 43 |
|
| 44 |
h1 {
|
|
|
|
| 53 |
#app {
|
| 54 |
max-width: 1280px;
|
| 55 |
margin: 0 auto;
|
| 56 |
+
padding: 3px;
|
| 57 |
text-align: center;
|
| 58 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
zeno-evals-hub/frontend/index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
-
<link rel="icon" type="image/svg+xml" href="./build/
|
| 6 |
<link rel="stylesheet" href="./build/smui.css" />
|
| 7 |
|
| 8 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -23,8 +23,25 @@
|
|
| 23 |
href="https://fonts.googleapis.com/css?family=Roboto+Mono"
|
| 24 |
/>
|
| 25 |
</head>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
<body>
|
| 27 |
<div id="app"></div>
|
| 28 |
<script type="module" src="http://localhost:5173/src/main.ts"></script>
|
| 29 |
</body>
|
| 30 |
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
+
<link rel="icon" type="image/svg+xml" href="./build/openai.svg" />
|
| 6 |
<link rel="stylesheet" href="./build/smui.css" />
|
| 7 |
|
| 8 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
| 23 |
href="https://fonts.googleapis.com/css?family=Roboto+Mono"
|
| 24 |
/>
|
| 25 |
</head>
|
| 26 |
+
<div id="header">
|
| 27 |
+
<img src="./build/openai.svg" alt="OpenAI SVG" />
|
| 28 |
+
<h2>OpenAI Evals Hub</h2>
|
| 29 |
+
</div>
|
| 30 |
<body>
|
| 31 |
<div id="app"></div>
|
| 32 |
<script type="module" src="http://localhost:5173/src/main.ts"></script>
|
| 33 |
</body>
|
| 34 |
</html>
|
| 35 |
+
<style>
|
| 36 |
+
#header {
|
| 37 |
+
display: flex;
|
| 38 |
+
align-items: center;
|
| 39 |
+
}
|
| 40 |
+
#header h2 {
|
| 41 |
+
margin: 10px;
|
| 42 |
+
}
|
| 43 |
+
#header img {
|
| 44 |
+
width: 50px;
|
| 45 |
+
height: 50px;
|
| 46 |
+
}
|
| 47 |
+
</style>
|
zeno-evals-hub/main.py
CHANGED
|
@@ -11,27 +11,20 @@ from zeno_evals import generate_zeno_config # type: ignore
|
|
| 11 |
|
| 12 |
|
| 13 |
# parse information in spec
|
| 14 |
-
def prepare_spec(
|
| 15 |
res = {}
|
| 16 |
-
|
| 17 |
data = []
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
break
|
| 30 |
-
|
| 31 |
-
res["accuracy"] = [
|
| 32 |
-
data[1]["final_report"]["accuracy"],
|
| 33 |
-
data2[1]["final_report"]["accuracy"] if second_exists else "",
|
| 34 |
-
]
|
| 35 |
return res
|
| 36 |
|
| 37 |
|
|
@@ -87,11 +80,22 @@ def command_line():
|
|
| 87 |
for entry in args:
|
| 88 |
name = list(entry.keys())[0]
|
| 89 |
params = entry[name]
|
|
|
|
| 90 |
second_exists = True if "second-results-file" in params else False
|
| 91 |
function_exists = True if "function-results" in params else False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
config = prepare_zeno_config(params, second_exists, function_exists)
|
| 93 |
-
params["spec"] = prepare_spec(params, second_exists)
|
| 94 |
-
params["zeno"] = prepare_zeno_params(config)
|
| 95 |
config.serve = False
|
| 96 |
zeno_obj = zeno(config)
|
| 97 |
if zeno_obj is None:
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
# parse information in spec
|
| 14 |
+
def prepare_spec(file_path):
|
| 15 |
res = {}
|
|
|
|
| 16 |
data = []
|
| 17 |
+
accuracy = 0
|
| 18 |
+
with open(file_path) as f:
|
| 19 |
+
for line in f:
|
| 20 |
+
json_entry = json.loads(line)
|
| 21 |
+
if "final_report" in json_entry:
|
| 22 |
+
accuracy = json_entry["final_report"]["accuracy"]
|
| 23 |
+
data.append(json_entry)
|
| 24 |
+
|
| 25 |
+
res["models"] = data[0]["spec"]["completion_fns"][0]
|
| 26 |
+
res["accuracy"] = accuracy * 100
|
| 27 |
+
res["events"] = len(data) - 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
return res
|
| 29 |
|
| 30 |
|
|
|
|
| 80 |
for entry in args:
|
| 81 |
name = list(entry.keys())[0]
|
| 82 |
params = entry[name]
|
| 83 |
+
|
| 84 |
second_exists = True if "second-results-file" in params else False
|
| 85 |
function_exists = True if "function-results" in params else False
|
| 86 |
+
|
| 87 |
+
res_spec = prepare_spec(params["results-file"])
|
| 88 |
+
params["models"] = [res_spec["models"]]
|
| 89 |
+
params["accuracy"] = [res_spec["accuracy"]]
|
| 90 |
+
params["events"] = [res_spec["events"]]
|
| 91 |
+
|
| 92 |
+
if second_exists:
|
| 93 |
+
sec_res_spec = prepare_spec(params["second-results-file"])
|
| 94 |
+
params["models"].append(sec_res_spec["models"])
|
| 95 |
+
params["accuracy"].append(sec_res_spec["accuracy"])
|
| 96 |
+
params["events"].append(sec_res_spec["events"])
|
| 97 |
+
|
| 98 |
config = prepare_zeno_config(params, second_exists, function_exists)
|
|
|
|
|
|
|
| 99 |
config.serve = False
|
| 100 |
zeno_obj = zeno(config)
|
| 101 |
if zeno_obj is None:
|