/** * import/foreign/vocab.ts — fit a ported checkpoint to a different vocabulary size. * * A ported model keeps its source tokenizer's vocabulary. To pair it with another * tokenizer the embedding table (tied to the LM head) must have that tokenizer's row * count: surplus rows are dropped, missing rows are drawn small and random so the * new tokens start near the embedding cloud's centre. The new rows are recorded on * the port as synthesised, never passed off as ported. */ import type { PortedCheckpoint } from "./registry.js"; export interface ResizeVocabOptions { /** Standard deviation of new rows. Default 0.02, the usual embedding init. */ std?: number; /** Seed for the new rows, so the same resize produces the same checkpoint. Default 1. */ seed?: number; } /** `ported` with an embedding of `vocabSize` rows and a model config to match. */ export declare function resizePortedVocab(ported: PortedCheckpoint, vocabSize: number, opts?: ResizeVocabOptions): PortedCheckpoint; //# sourceMappingURL=vocab.d.ts.map