Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1/** @import { BlurParams, CrossfadeParams, DrawParams, FadeParams, FlyParams, ScaleParams, SlideParams, TransitionConfig } from './public' */2 3import { DEV } from 'esm-env';4import * as w from '../internal/client/warnings.js';5 6/** @param {number} x */7const linear = (x) => x;8 9/** @param {number} t */10function cubic_out(t) {11 const f = t - 1.0;12 return f * f * f + 1.0;13}14 15/**16 * @param {number} t17 * @returns {number}18 */19function cubic_in_out(t) {20 return t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0;21}22 23/** @param {number | string} value24 * @returns {[number, string]}25 */26function split_css_unit(value) {27 const split = typeof value === 'string' && value.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);28 return split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px'];29}30 31/**32 * Animates a `blur` filter alongside an element's opacity.33 *34 * @param {Element} node35 * @param {BlurParams} [params]36 * @returns {TransitionConfig}37 */38export function blur(39 node,40 { delay = 0, duration = 400, easing = cubic_in_out, amount = 5, opacity = 0 } = {}41) {42 const style = getComputedStyle(node);43 const target_opacity = +style.opacity;44 const f = style.filter === 'none' ? '' : style.filter;45 const od = target_opacity * (1 - opacity);46 const [value, unit] = split_css_unit(amount);47 return {48 delay,49 duration,50 easing,51 css: (_t, u) => `opacity: ${target_opacity - od * u}; filter: ${f} blur(${u * value}${unit});`52 };53}54 55/**56 * Animates the opacity of an element from 0 to the current opacity for `in` transitions and from the current opacity to 0 for `out` transitions.57 *58 * @param {Element} node59 * @param {FadeParams} [params]60 * @returns {TransitionConfig}61 */62export function fade(node, { delay = 0, duration = 400, easing = linear } = {}) {63 const o = +getComputedStyle(node).opacity;64 return {65 delay,66 duration,67 easing,68 css: (t) => `opacity: ${t * o}`69 };70}71 72/**73 * Animates the x and y positions and the opacity of an element. `in` transitions animate from the provided values, passed as parameters to the element's default values. `out` transitions animate from the element's default values to the provided values.74 *75 * @param {Element} node76 * @param {FlyParams} [params]77 * @returns {TransitionConfig}78 */79export function fly(80 node,81 { delay = 0, duration = 400, easing = cubic_out, x = 0, y = 0, opacity = 0 } = {}82) {83 const style = getComputedStyle(node);84 const target_opacity = +style.opacity;85 const transform = style.transform === 'none' ? '' : style.transform;86 const od = target_opacity * (1 - opacity);87 const [x_value, x_unit] = split_css_unit(x);88 const [y_value, y_unit] = split_css_unit(y);89 return {90 delay,91 duration,92 easing,93 css: (t, u) => `94 transform: ${transform} translate(${(1 - t) * x_value}${x_unit}, ${(1 - t) * y_value}${y_unit});95 opacity: ${target_opacity - od * u}`96 };97}98 99var slide_warning = false;100 101/**102 * Slides an element in and out.103 *104 * @param {Element} node105 * @param {SlideParams} [params]106 * @returns {TransitionConfig}107 */108export function slide(node, { delay = 0, duration = 400, easing = cubic_out, axis = 'y' } = {}) {109 const style = getComputedStyle(node);110 111 if (DEV && !slide_warning && /(contents|inline|table)/.test(style.display)) {112 slide_warning = true;113 Promise.resolve().then(() => (slide_warning = false));114 w.transition_slide_display(style.display);115 }116 117 const opacity = +style.opacity;118 const primary_property = axis === 'y' ? 'height' : 'width';119 const primary_property_value = parseFloat(style[primary_property]);120 const secondary_properties = axis === 'y' ? ['top', 'bottom'] : ['left', 'right'];121 const capitalized_secondary_properties = secondary_properties.map(122 (e) => /** @type {'Left' | 'Right' | 'Top' | 'Bottom'} */ (`${e[0].toUpperCase()}${e.slice(1)}`)123 );124 const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);125 const padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);126 const margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);127 const margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);128 const border_width_start_value = parseFloat(129 style[`border${capitalized_secondary_properties[0]}Width`]130 );131 const border_width_end_value = parseFloat(132 style[`border${capitalized_secondary_properties[1]}Width`]133 );134 return {135 delay,136 duration,137 easing,138 css: (t) =>139 'overflow: hidden;' +140 `opacity: ${Math.min(t * 20, 1) * opacity};` +141 `${primary_property}: ${t * primary_property_value}px;` +142 `padding-${secondary_properties[0]}: ${t * padding_start_value}px;` +143 `padding-${secondary_properties[1]}: ${t * padding_end_value}px;` +144 `margin-${secondary_properties[0]}: ${t * margin_start_value}px;` +145 `margin-${secondary_properties[1]}: ${t * margin_end_value}px;` +146 `border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;` +147 `border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;` +148 `min-${primary_property}: 0`149 };150}151 152/**153 * Animates the opacity and scale of an element. `in` transitions animate from the provided values, passed as parameters, to an element's current (default) values. `out` transitions animate from an element's default values to the provided values.154 *155 * @param {Element} node156 * @param {ScaleParams} [params]157 * @returns {TransitionConfig}158 */159export function scale(160 node,161 { delay = 0, duration = 400, easing = cubic_out, start = 0, opacity = 0 } = {}162) {163 const style = getComputedStyle(node);164 const target_opacity = +style.opacity;165 const transform = style.transform === 'none' ? '' : style.transform;166 const sd = 1 - start;167 const od = target_opacity * (1 - opacity);168 return {169 delay,170 duration,171 easing,172 css: (_t, u) => `173 transform: ${transform} scale(${1 - sd * u});174 opacity: ${target_opacity - od * u}175 `176 };177}178 179/**180 * Animates the stroke of an SVG element, like a snake in a tube. `in` transitions begin with the path invisible and draw the path to the screen over time. `out` transitions start in a visible state and gradually erase the path. `draw` only works with elements that have a `getTotalLength` method, like `<path>` and `<polyline>`.181 *182 * @param {SVGElement & { getTotalLength(): number }} node183 * @param {DrawParams} [params]184 * @returns {TransitionConfig}185 */186export function draw(node, { delay = 0, speed, duration, easing = cubic_in_out } = {}) {187 let len = node.getTotalLength();188 const style = getComputedStyle(node);189 if (style.strokeLinecap !== 'butt') {190 len += parseInt(style.strokeWidth);191 }192 if (duration === undefined) {193 if (speed === undefined) {194 duration = 800;195 } else {196 duration = len / speed;197 }198 } else if (typeof duration === 'function') {199 duration = duration(len);200 }201 return {202 delay,203 duration,204 easing,205 css: (_, u) => `206 stroke-dasharray: ${len};207 stroke-dashoffset: ${u * len};208 `209 };210}211 212/**213 * @template T214 * @template S215 * @param {T} tar216 * @param {S} src217 * @returns {T & S}218 */219function assign(tar, src) {220 // @ts-ignore221 for (const k in src) tar[k] = src[k];222 return /** @type {T & S} */ (tar);223}224 225/**226 * The `crossfade` function creates a pair of [transitions](https://svelte.dev/docs/svelte/transition) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.227 *228 * @param {CrossfadeParams & {229 * fallback?: (node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig;230 * }} params231 * @returns {[(node: any, params: CrossfadeParams & { key: any; }) => () => TransitionConfig, (node: any, params: CrossfadeParams & { key: any; }) => () => TransitionConfig]}232 */233export function crossfade({ fallback, ...defaults }) {234 /** @type {Map<any, Element>} */235 const to_receive = new Map();236 /** @type {Map<any, Element>} */237 const to_send = new Map();238 239 /**240 * @param {Element} from_node241 * @param {Element} node242 * @param {CrossfadeParams} params243 * @returns {TransitionConfig}244 */245 function crossfade(from_node, node, params) {246 const {247 delay = 0,248 duration = /** @param {number} d */ (d) => Math.sqrt(d) * 30,249 easing = cubic_out250 } = assign(assign({}, defaults), params);251 const from = from_node.getBoundingClientRect();252 const to = node.getBoundingClientRect();253 const dx = from.left - to.left;254 const dy = from.top - to.top;255 const dw = from.width / to.width;256 const dh = from.height / to.height;257 const d = Math.sqrt(dx * dx + dy * dy);258 const style = getComputedStyle(node);259 const transform = style.transform === 'none' ? '' : style.transform;260 const opacity = +style.opacity;261 return {262 delay,263 duration: typeof duration === 'function' ? duration(d) : duration,264 easing,265 css: (t, u) => `266 opacity: ${t * opacity};267 transform-origin: top left;268 transform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1 - t) * dw}, ${269 t + (1 - t) * dh270 });271 `272 };273 }274 275 /**276 * @param {Map<any, Element>} items277 * @param {Map<any, Element>} counterparts278 * @param {boolean} intro279 * @returns {(node: any, params: CrossfadeParams & { key: any; }) => () => TransitionConfig}280 */281 function transition(items, counterparts, intro) {282 // @ts-expect-error TODO improve typings (are the public types wrong?)283 return (node, params) => {284 items.set(params.key, node);285 return () => {286 if (counterparts.has(params.key)) {287 const other_node = counterparts.get(params.key);288 counterparts.delete(params.key);289 return crossfade(/** @type {Element} */ (other_node), node, params);290 }291 // if the node is disappearing altogether292 // (i.e. wasn't claimed by the other list)293 // then we need to supply an outro294 items.delete(params.key);295 return fallback && fallback(node, params, intro);296 };297 };298 }299 return [transition(to_send, to_receive, false), transition(to_receive, to_send, true)];300}301 