needle-playground / src /sentencepiece-js.d.ts
shreyask's picture
Upload folder using huggingface_hub
814c07e verified
raw
history blame contribute delete
485 Bytes
// Minimal ambient type declarations for the sentencepiece-js package.
// The package ships no .d.ts files; this declaration satisfies tsc's type-checking.
declare module 'sentencepiece-js' {
export class SentencePieceProcessor {
load(url: string): Promise<void>;
loadVocabulary(url: string): void;
encodeIds(text: string): number[];
encodePieces(text: string): string[];
decodeIds(ids: number[]): string;
}
export function cleanText(text: string): string;
}