bitgpu 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -11
- package/dist/chat.d.ts +95 -4
- package/dist/chat.js +409 -17
- package/dist/chat.js.map +1 -1
- package/dist/gguf.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +178 -46
- package/dist/index.js.map +1 -1
- package/dist/{types-Wg8VrdrL.d.ts → types-CSpyQjyc.d.ts} +32 -2
- package/package.json +1 -1
|
@@ -211,11 +211,41 @@ interface GenerateOptions {
|
|
|
211
211
|
/** Top-k sampling cutoff (candidate count). Default `20` when sampling; clamped to `[1, vocab]`
|
|
212
212
|
* (the GPU reduces the logits to this many candidates, so `0` cannot mean "disabled"). */
|
|
213
213
|
topK?: number;
|
|
214
|
-
/** Top-p (nucleus) cutoff
|
|
214
|
+
/** Top-p (nucleus) cutoff, applied over the top-K candidates when sampling: keeps the shortest
|
|
215
|
+
* leading run whose cumulative probability reaches `topP`. Default `1` (off). Only affects
|
|
216
|
+
* sampling (greedy takes the penalized argmax regardless). */
|
|
215
217
|
topP?: number;
|
|
218
|
+
/** Min-p cutoff, applied over the top-K candidates when sampling: keeps tokens whose probability
|
|
219
|
+
* is at least `minP` * (the top token's probability), so the pool tightens when the model is
|
|
220
|
+
* confident and widens when it is not. Default `0` (off). Robust for low-precision models. Only
|
|
221
|
+
* affects sampling. */
|
|
222
|
+
minP?: number;
|
|
216
223
|
/** Repetition penalty over the deduped prompt+generated id set (`logit<0 ? *p : /p`). Default `1`
|
|
217
224
|
* (off). Applied under greedy decoding too (the penalized argmax), matching transformers.js. */
|
|
218
225
|
repetitionPenalty?: number;
|
|
226
|
+
/** Presence penalty: subtracts this flat amount from the logit of every token seen so far (the
|
|
227
|
+
* additive anti-repetition knob the Qwen3.5 family recommends, applied after `repetitionPenalty`).
|
|
228
|
+
* Default `0` (off). Applied on the full vocab before top-k, under greedy decoding too. */
|
|
229
|
+
presencePenalty?: number;
|
|
230
|
+
/** DRY ("don't repeat yourself") repetition penalty strength. Default `0` (off). When a candidate
|
|
231
|
+
* token would EXTEND a repeat - the last L history tokens followed by it reproduce an earlier
|
|
232
|
+
* stretch - and L >= `dryAllowedLength`, its logit drops by
|
|
233
|
+
* `dryMultiplier * dryBase^(L - dryAllowedLength)`. Targets loops that per-token penalties miss
|
|
234
|
+
* while leaving legitimately repeated single tokens alone. Applied on the CPU over the top-K
|
|
235
|
+
* candidates (like `topP`/`minP`), under greedy decoding too; reported logprobs are pre-DRY.
|
|
236
|
+
* Not supported together with `promptLookup` (with `'auto'`, lookup simply stays off). */
|
|
237
|
+
dryMultiplier?: number;
|
|
238
|
+
/** DRY exponential base (default `1.75`). */
|
|
239
|
+
dryBase?: number;
|
|
240
|
+
/** Repeat length that DRY tolerates before penalizing (default `2`). */
|
|
241
|
+
dryAllowedLength?: number;
|
|
242
|
+
/** DRY only searches the last `dryRange` history tokens (default `0` = the whole history). */
|
|
243
|
+
dryRange?: number;
|
|
244
|
+
/** Token ids that act as DRY sequence breakers: matching never crosses them and they are never
|
|
245
|
+
* penalized themselves (structural tokens - newlines, quotes, list markers - legitimately
|
|
246
|
+
* repeat). Default none. `bitgpu/chat` fills this with the tokenizer's newline/punctuation
|
|
247
|
+
* tokens when DRY is enabled. */
|
|
248
|
+
dryBreakers?: number[];
|
|
219
249
|
/** Block any n-gram of this size from repeating. Default `0` (off). Applied under greedy decoding
|
|
220
250
|
* too, matching transformers.js. */
|
|
221
251
|
noRepeatNgramSize?: number;
|
|
@@ -424,4 +454,4 @@ interface Engine {
|
|
|
424
454
|
}
|
|
425
455
|
//#endregion
|
|
426
456
|
export { ForwardResult as a, KvSnapshot as c, ManifestArch as d, ManifestRef as f, EngineOptions as i, LoadProgress as l, TokenLogprobs as m, Engine as n, GenerateOptions as o, ManifestTensor as p, EngineCapabilities as r, GenerateResult as s, DeviceLostInfo as t, Manifest as u };
|
|
427
|
-
//# sourceMappingURL=types-
|
|
457
|
+
//# sourceMappingURL=types-CSpyQjyc.d.ts.map
|