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
1import { calculateSize } from "../svg/size.js";2import { isUnsetKeyword } from "../svg/build.js";3const svgWidthRegex = /\swidth\s*=\s*["']([^"']+)["']/;4const svgHeightRegex = /\sheight\s*=\s*["']([^"']+)["']/;5const svgViewBoxRegex = /\sviewBox\s*=\s*["']([^"']+)["']/;6const svgTagRegex = /<svg\s+/;7const loaderDefaultWidthProp = "__iconify_loader_width";8const loaderDefaultHeightProp = "__iconify_loader_height";9function stringifySize(value) {10 return value === void 0 ? value : value.toString();11}12function getConfiguredSize(source, scale) {13 if (typeof scale === "number") return scale > 0 ? stringifySize(calculateSize(source ?? "1em", scale)) : void 0;14 return source;15}16function getSvgAspectRatio(svgNode, props) {17 const viewBox = props.viewBox ?? svgViewBoxRegex.exec(svgNode)?.[1];18 if (!viewBox) return;19 const values = viewBox.trim().split(/[\s,]+/).map((value) => parseFloat(value));20 if (values.length !== 4 || values.some((value) => !Number.isFinite(value))) return;21 const width = values[2];22 const height = values[3];23 if (width <= 0 || height <= 0) return;24 return width / height;25}26function configureSvgSize(svg, props, scale) {27 const svgNode = svg.slice(0, svg.indexOf(">"));28 const widthOnSvg = svgWidthRegex.test(svgNode);29 const heightOnSvg = svgHeightRegex.test(svgNode);30 const defaultWidth = props["__iconify_loader_width"] ?? svgWidthRegex.exec(svgNode)?.[1];31 const defaultHeight = props["__iconify_loader_height"] ?? svgHeightRegex.exec(svgNode)?.[1];32 const aspectRatio = getSvgAspectRatio(svgNode, props);33 delete props[loaderDefaultWidthProp];34 delete props[loaderDefaultHeightProp];35 const customWidth = props.width;36 const customHeight = props.height;37 const hasCustomWidth = !!customWidth || isUnsetKeyword(customWidth);38 const hasCustomHeight = !!customHeight || isUnsetKeyword(customHeight);39 if (hasCustomWidth || hasCustomHeight) {40 if (!hasCustomWidth) if (isUnsetKeyword(customHeight)) {41 delete props.width;42 delete props.height;43 } else if (aspectRatio) {44 props.width = stringifySize(calculateSize(customHeight, aspectRatio));45 props.height = customHeight;46 } else delete props.width;47 else if (isUnsetKeyword(customWidth)) {48 delete props.width;49 if (!hasCustomHeight || isUnsetKeyword(customHeight)) delete props.height;50 }51 if (!hasCustomHeight) if (isUnsetKeyword(customWidth)) delete props.height;52 else if (aspectRatio) {53 props.height = stringifySize(calculateSize(customWidth, 1 / aspectRatio));54 props.width = customWidth;55 } else delete props.height;56 else if (isUnsetKeyword(customHeight)) delete props.height;57 } else {58 const width = getConfiguredSize(defaultWidth, scale);59 const height = getConfiguredSize(defaultHeight, scale);60 if (width) props.width = width;61 if (height) props.height = height;62 }63 return [widthOnSvg, heightOnSvg];64}65async function mergeIconProps(svg, collection, icon, options, propsProvider, afterCustomizations) {66 const { scale, addXmlNs = false } = options ?? {};67 const { additionalProps = {}, iconCustomizer } = options?.customizations ?? {};68 const props = await propsProvider?.() ?? {};69 await iconCustomizer?.(collection, icon, props);70 Object.keys(additionalProps).forEach((p) => {71 const v = additionalProps[p];72 if (v !== void 0 && v !== null) props[p] = v;73 });74 afterCustomizations?.(props);75 const [widthOnSvg, heightOnSvg] = configureSvgSize(svg, props, scale);76 if (addXmlNs) {77 if (!svg.includes("xmlns=") && !props["xmlns"]) props["xmlns"] = "http://www.w3.org/2000/svg";78 if (!svg.includes("xmlns:xlink=") && svg.includes("xlink:") && !props["xmlns:xlink"]) props["xmlns:xlink"] = "http://www.w3.org/1999/xlink";79 }80 const propsToAdd = Object.keys(props).map((p) => p === "width" && widthOnSvg || p === "height" && heightOnSvg ? null : `${p}="${props[p]}"`).filter((p) => p != null);81 if (propsToAdd.length) svg = svg.replace(svgTagRegex, `<svg ${propsToAdd.join(" ")} `);82 if (options) {83 const { defaultStyle, defaultClass } = options;84 if (defaultClass && !svg.includes("class=")) svg = svg.replace(svgTagRegex, `<svg class="${defaultClass}" `);85 if (defaultStyle && !svg.includes("style=")) svg = svg.replace(svgTagRegex, `<svg style="${defaultStyle}" `);86 }87 const usedProps = options?.usedProps;88 if (usedProps) {89 Object.keys(additionalProps).forEach((p) => {90 const v = props[p];91 if (v !== void 0 && v !== null) usedProps[p] = v;92 });93 if (typeof props.width !== "undefined" && props.width !== null) usedProps.width = props.width;94 if (typeof props.height !== "undefined" && props.height !== null) usedProps.height = props.height;95 }96 return svg;97}98function getPossibleIconNames(icon) {99 return [100 icon,101 icon.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(),102 icon.replace(/([a-z])(\d+)/g, "$1-$2")103 ];104}105export { getPossibleIconNames, loaderDefaultHeightProp, loaderDefaultWidthProp, mergeIconProps };106 