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/** @typedef {{ file: string, line: number, column: number }} Location */2 3import { get_descriptor } from '../../shared/utils.js';4import { LEGACY_PROPS, STATE_SYMBOL } from '#client/constants';5import { FILENAME } from '../../../constants.js';6import { component_context } from '../context.js';7import * as w from '../warnings.js';8import { sanitize_location } from '../../../utils.js';9 10/**11 * Sets up a validator that12 * - traverses the path of a prop to find out if it is allowed to be mutated13 * - checks that the binding chain is not interrupted14 * @param {Record<string, any>} props15 */16export function create_ownership_validator(props) {17 const component = component_context?.function;18 const parent = component_context?.p?.function;19 20 return {21 /**22 * @param {string} prop23 * @param {any[]} path24 * @param {any} result25 * @param {number} line26 * @param {number} column27 */28 mutation: (prop, path, result, line, column) => {29 const name = path[0];30 if (is_bound_or_unset(props, name) || !parent) {31 return result;32 }33 34 /** @type {any} */35 let value = props;36 37 for (let i = 0; i < path.length - 1; i++) {38 value = value[path[i]];39 if (!value?.[STATE_SYMBOL]) {40 return result;41 }42 }43 44 const location = sanitize_location(`${component[FILENAME]}:${line}:${column}`);45 46 w.ownership_invalid_mutation(name, location, prop, parent[FILENAME]);47 48 return result;49 },50 /**51 * @param {any} key52 * @param {any} child_component53 * @param {() => any} value54 */55 binding: (key, child_component, value) => {56 if (!is_bound_or_unset(props, key) && parent && value()?.[STATE_SYMBOL]) {57 w.ownership_invalid_binding(58 component[FILENAME],59 key,60 child_component[FILENAME],61 parent[FILENAME]62 );63 }64 }65 };66}67 68/**69 * @param {Record<string, any>} props70 * @param {string} prop_name71 */72function is_bound_or_unset(props, prop_name) {73 // Can be the case when someone does `mount(Component, props)` with `let props = $state({...})`74 // or `createClassComponent(Component, props)`75 const is_entry_props = STATE_SYMBOL in props || LEGACY_PROPS in props;76 return (77 !!get_descriptor(props, prop_name)?.set ||78 (is_entry_props && prop_name in props) ||79 !(prop_name in props)80 );81}82 