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 { DEV } from 'esm-env';2import { state, increment } from '../internal/client/reactivity/sources.js';3import { tag } from '../internal/client/dev/tracing.js';4import { get } from '../internal/client/runtime.js';5import { get_current_url } from './url.js';6 7export const REPLACE = Symbol('replace');8 9/**10 * A reactive version of the built-in [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) object.11 * Reading its contents (by iterating, or by calling `params.get(...)` or `params.getAll(...)` as in the [example](https://svelte.dev/playground/b3926c86c5384bab9f2cf993bc08c1c8) below) in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)12 * will cause it to be re-evaluated as necessary when the params are updated.13 *14 * ```svelte15 * <script>16 * import { SvelteURLSearchParams } from 'svelte/reactivity';17 *18 * const params = new SvelteURLSearchParams('message=hello');19 *20 * let key = $state('key');21 * let value = $state('value');22 * </script>23 *24 * <input bind:value={key} />25 * <input bind:value={value} />26 * <button onclick={() => params.append(key, value)}>append</button>27 *28 * <p>?{params.toString()}</p>29 *30 * {#each params as [key, value]}31 * <p>{key}: {value}</p>32 * {/each}33 * ```34 */35export class SvelteURLSearchParams extends URLSearchParams {36 #version = DEV ? tag(state(0), 'SvelteURLSearchParams version') : state(0);37 #url = get_current_url();38 39 #updating = false;40 41 #update_url() {42 if (!this.#url || this.#updating) return;43 this.#updating = true;44 45 const search = this.toString();46 this.#url.search = search && `?${search}`;47 48 this.#updating = false;49 }50 51 /**52 * @param {URLSearchParams} params53 * @internal54 */55 [REPLACE](params) {56 if (this.#updating) return;57 this.#updating = true;58 59 for (const key of [...super.keys()]) {60 super.delete(key);61 }62 63 for (const [key, value] of params) {64 super.append(key, value);65 }66 67 increment(this.#version);68 this.#updating = false;69 }70 71 /**72 * @param {string} name73 * @param {string} value74 * @returns {void}75 */76 append(name, value) {77 super.append(name, value);78 this.#update_url();79 increment(this.#version);80 }81 82 /**83 * @param {string} name84 * @param {string=} value85 * @returns {void}86 */87 delete(name, value) {88 var has_value = super.has(name, value);89 super.delete(name, value);90 if (has_value) {91 this.#update_url();92 increment(this.#version);93 }94 }95 96 /**97 * @param {string} name98 * @returns {string|null}99 */100 get(name) {101 get(this.#version);102 return super.get(name);103 }104 105 /**106 * @param {string} name107 * @returns {string[]}108 */109 getAll(name) {110 get(this.#version);111 return super.getAll(name);112 }113 114 /**115 * @param {string} name116 * @param {string=} value117 * @returns {boolean}118 */119 has(name, value) {120 get(this.#version);121 return super.has(name, value);122 }123 124 keys() {125 get(this.#version);126 return super.keys();127 }128 129 /**130 * @param {string} name131 * @param {string} value132 * @returns {void}133 */134 set(name, value) {135 var previous = super.getAll(name);136 super.set(name, value);137 // can't use has(name, value), because for something like https://svelte.dev?foo=1&bar=2&foo=3138 // if you set `foo` to 1, then foo=3 gets deleted whilst `has("foo", "1")` returns true139 var current = super.getAll(name);140 if (previous.length !== current.length || previous.some((value, i) => value !== current[i])) {141 this.#update_url();142 increment(this.#version);143 }144 }145 146 sort() {147 super.sort();148 this.#update_url();149 increment(this.#version);150 }151 152 toString() {153 get(this.#version);154 return super.toString();155 }156 157 values() {158 get(this.#version);159 return super.values();160 }161 162 entries() {163 get(this.#version);164 return super.entries();165 }166 167 [Symbol.iterator]() {168 return this.entries();169 }170 171 get size() {172 get(this.#version);173 return super.size;174 }175}176 