File size: 1,987 Bytes
1944112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
 * Walk a DataTransfer from a drop event into flat `{ path, file }` entries.
 * Uses the entries API so dropping a *folder* works, not just a file selection.
 */
export function filesFromDataTransfer(dataTransfer: any): Promise<any[]>;
/**
 * Turns `<input webkitdirectory>` output into the same `{ path, file }` shape.
 *
 * `Array.from`, not spread: a real `FileList` is iterable, but plenty of things
 * that behave like one are only array-like, and spreading those fails with
 * "fileList is not iterable" — an error that names none of the three places it
 * could have come from. Array.from accepts both.
 */
export function filesFromInput(fileList: any): {
    path: any;
    file: any;
}[];
/**
 * @param {Array<{path: string, file: File}>} entries
 * @param {object} opts
 * @param {import("./model-store.js").ModelStore} opts.store where the registry entry lands
 * @param {string} [opts.modelId] overrides the id inferred from the folder name
 * @param {"llm"|"embedding"|"vlm"} [opts.modelType] declare a vision model, or WebLLM
 *   rejects every image sent to it
 * @param {(p: {phase: string, done: number, total: number, label: string}) => void} [opts.onProgress]
 * @returns {Promise<object>} the saved registry record
 */
export function ingestModelFolder(entries: Array<{
    path: string;
    file: File;
}>, { store, modelId, modelType, onProgress }?: {
    store: import("./model-store.js").ModelStore;
    modelId?: string;
    modelType?: "llm" | "embedding" | "vlm";
    onProgress?: (p: {
        phase: string;
        done: number;
        total: number;
        label: string;
    }) => void;
}): Promise<object>;
/** WebLLM asks for this name; older MLC exports ship `ndarray-cache.json`. */
export const TENSOR_MANIFEST: "tensor-cache.json";
export const LEGACY_TENSOR_MANIFEST: "ndarray-cache.json";
export const CHAT_CONFIG: "mlc-chat-config.json";
export namespace CONTENT_TYPES {
    let json: string;
    let wasm: string;
    let bin: string;
}