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// @ts-check2 3import { page, server, utils } from 'vitest/browser'4import { cleanup, render as coreRender } from '@testing-library/svelte-core'5 6const { debug, getElementLocatorSelectors } = utils7 8/**9 * The rendered component and bound testing functions.10 *11 * @template {import('@testing-library/svelte-core/types').Component} C12 *13 * @typedef {{14 * container: HTMLElement15 * baseElement: HTMLElement16 * component: import('@testing-library/svelte-core/types').Exports<C>17 * debug: (el?: HTMLElement) => void18 * rerender: import('@testing-library/svelte-core/types').Rerender<C>19 * unmount: () => void20 * locator: import('vitest/browser').Locator21 * } & import('vitest/browser').LocatorSelectors} RenderResult22 */23 24/**25 * Render a component into the document.26 * Also records a `svelte.render` trace mark.27 *28 * Synchronous usage is deprecated and will be removed in the next major version.29 * Please use `await render(Component)` instead of `render(Component)`.30 *31 * @template {import('@testing-library/svelte-core/types').Component} C32 *33 * @param {import('@testing-library/svelte-core/types').ComponentImport<C>} Component - The component to render.34 * @param {import('@testing-library/svelte-core/types').ComponentOptions<C>} options - Customize how Svelte renders the component.35 * @param {import('@testing-library/svelte-core/types').SetupOptions} renderOptions - Customize how the document and queries are set up.36 * @returns {RenderResult<C>} The rendered component and bound testing functions.37 */38function render(Component, options = {}, renderOptions = {}) {39 const { baseElement, container, component, rerender, unmount } = coreRender(Component, options, renderOptions)40 ensureTestIdAttribute(baseElement)41 ensureTestIdAttribute(container)42 43 const queries = getElementLocatorSelectors(baseElement)44 const locator = page.elementLocator(container)45 46 const result = {47 baseElement,48 component,49 container,50 locator,51 rerender: async (/** @type {any} */ props) => {52 await rerender(props)53 await markThenable(locator, 'svelte.rerender', result.rerender, undefined)54 },55 unmount: () => {56 unmount()57 return markThenable(locator, 'svelte.unmount', result.unmount, undefined)58 },59 debug: (el = baseElement) => {60 debug(el)61 },62 ...queries,63 }64 return { ...result, ...markThenable(locator, 'svelte.render', render, result) }65}66 67export { cleanup, render }68 69/**70 * @template T71 * @param {import('vitest/browser').Locator} locator72 * @param {string} name73 * @param {Function} fn74 * @param {T} value75 * @returns {PromiseLike<T>}76 */77function markThenable(locator, name, fn, value) {78 if (!locator.mark) {79 return { then: (/** @type {any} */ f) => f?.(value) }80 }81 const error = new Error(name)82 if ('captureStackTrace' in Error && typeof Error.captureStackTrace === 'function') {83 Error.captureStackTrace(error, fn)84 }85 return {86 async then(onfulfilled, onrejected) {87 try {88 await locator.mark(name, error)89 return Promise.resolve(value).then(onfulfilled, onrejected)90 }91 catch (e) {92 return Promise.reject(e).then(onfulfilled, onrejected)93 }94 },95 }96}97 98let idx = 099/**100 * @param {HTMLElement} element101 */102function ensureTestIdAttribute(element) {103 const attributeId = server.config.browser.locators.testIdAttribute104 if (!element.hasAttribute(attributeId)) {105 element.setAttribute(attributeId, `__vitest_${idx++}__`)106 }107}108 