MCPcopy Create free account

hub / github.com/cztomsik/ggml-js / functions

Functions74 in github.com/cztomsik/ggml-js

↓ 18 callersMethodnewTensor
* Create a new tensor (shape in reverse order). * @param {string} type - Tensor type. * @param {...number} dims - Tensor shape.
lib/core/context.js:41
↓ 17 callersMethodcallOp
(nativeFun, ...args)
lib/core/context.js:32
↓ 16 callersFunctionunaryOp
lib/core/functional.js:4
↓ 12 callersMethodforward
(x, state, updates = [])
lib/llms/rwkv.js:35
↓ 11 callersMethodset
* Set value at the given index. * @param {number} index * @param {number} value * @returns {Tensor}
lib/core/tensor.js:72
↓ 10 callersMethodforward
(x)
lib/llms/gpt-neox.js:87
↓ 9 callersMethodloadFromFile
* Load a model from a file. * @type {<T extends typeof Model>(this: T, path: string, hparams?: ConstructorParameters<T>[1]) => InstanceType<T>}
lib/core/model.js:26
↓ 7 callersFunctionbinaryOp
lib/core/functional.js:5
↓ 7 callersMethodget
* Get value at the given index. * @param {number} index * @returns {number}
lib/core/tensor.js:58
↓ 5 callersMethoddecodeOne
* Decode one token into a Uint8Array. * @param {number} token * @returns {Uint8Array} * @abstract
lib/tokenizers/tokenizer.js:65
↓ 5 callersMethodencode
* Encode a string into tokens. * @param {string} text * @returns {number[]} * @abstract
lib/tokenizers/tokenizer.js:36
↓ 5 callersFunctionmix
(x, prev_x, w)
lib/llms/rwkv.js:125
↓ 4 callersMethodcompute
* Compute the graph.
lib/core/context.js:72
↓ 4 callersMethodgenerate
* @param {number[]} input - Array of input token IDs. * @param {object} [options] * @param {number} [options.max_tokens=100] - Maximum number of
lib/llms/causal.js:43
↓ 4 callersMethodinit
* Initialize the context.
lib/core/context.js:20
↓ 3 callersMethodbuildForward
* Build a graph for forward computation. * @param {Tensor} tensor
lib/core/context.js:51
↓ 3 callersFunctionwrap
(Clz, obj, ...extra)
lib/core/native.js:15
↓ 2 callersMethodbpe
(word)
lib/tokenizers/bpe-tokenizer.js:54
↓ 2 callersMethodcollectTensors
* Go through all tensors in the model and collect them with their names. * @returns {Array<[string, Tensor]>}
lib/core/model.js:77
↓ 2 callersMethodsplit
* Split a tensor into chunks of the given size along the first dimension. * @param {number} chunkSize * @returns {Tensor[]}
lib/core/tensor.js:151
↓ 2 callersMethodview
* Get a view of the tensor (shape in reverse order). * @param {...number} dims * @returns {Tensor}
lib/core/tensor.js:87
↓ 1 callersMethodbuildForwardExpand
* TODO: document this
lib/core/context.js:93
↓ 1 callersMethodcontiguous
* Make the tensor contiguous in memory. * @returns {Tensor}
lib/core/tensor.js:179
↓ 1 callersMethoddecode
* Decode tokens into a string. * @param {number[]} tokens * @returns {string}
lib/tokenizers/tokenizer.js:45
↓ 1 callersMethodencode
* @override
lib/tokenizers/bpe-tokenizer.js:38
↓ 1 callersMethodforward
* @param {Tensor} x - Input tensor. * @param {any} state * @param {Tensor[]} updates - Array of tensors that should be updated after the forward
lib/llms/causal.js:19
↓ 1 callersMethodgetInitialState
* Prepare the initial state. * @param {Context} cx * @returns {any} Initial state. * @abstract
lib/llms/causal.js:29
↓ 1 callersMethodmerge
(word, bigram)
lib/tokenizers/bpe-tokenizer.js:64
↓ 1 callersMethodpermute
* Permute the tensor. * @param {number} axis0 * @param {number} axis1 * @param {number} axis2 * @param {number} axis3 * @returns {Tenso
lib/core/tensor.js:134
↓ 1 callersMethodprint
* Print all tensors in the model.
lib/core/model.js:101
↓ 1 callersMethodsetAll
* Set all elements to the given value. * @param {number} value * @returns {Tensor}
lib/core/tensor.js:41
Methodconstructor
({ vocab, merges, added_tokens })
lib/tokenizers/bpe-tokenizer.js:15
Methodconstructor
* Create an empty model. * @param {Context} context * @param {Object} hparams
lib/core/model.js:15
Methodconstructor
* @param {Module} parentModule - A parent module. * @param {number} numEmbeddings - The size of the vocabulary. * @param {number} dim - The embe
lib/core/layers.js:13
Methodconstructor
* @param {Module} parentModule - A parent module. * @param {number} dim - The embedding dimension.
lib/core/layers.js:33
Methodconstructor
* @param {Module} parentModule - A parent module. * @param {number} inputDim - The input dimension. * @param {number} outputDim - The output dim
lib/core/layers.js:55
Methodconstructor
* Create a new module. * @param {Module} parentModule
lib/core/module.js:16
Methodconstructor
* Create a new RWKV model. * @param {Context} context * @param {{ vocab_size: number, embed_dim: number, num_layers: number }} hparams
lib/llms/rwkv.js:20
Methodconstructor
(parentModule, dim)
lib/llms/rwkv.js:43
Methodconstructor
(parentModule, dim)
lib/llms/rwkv.js:58
Methodconstructor
(parentModule, dim)
lib/llms/rwkv.js:104
Methodconstructor
(context, { vocab_size, embed_dim, num_layers, num_heads, num_rot })
lib/llms/gpt-neox.js:5
Methodconstructor
(parentModule, embed_dim, num_heads, num_rot)
lib/llms/gpt-neox.js:25
Methodconstructor
(parentModule, embed_dim, num_heads, num_rot)
lib/llms/gpt-neox.js:42
Methodconstructor
(parentModule, dim)
lib/llms/gpt-neox.js:81
MethoddecodeOne
* @override
lib/tokenizers/bpe-tokenizer.js:75
MethodelementSize
* Size of one element in bytes. * @returns {BigInt}
lib/core/tensor.js:32
Functionembedding
(input, weight)
lib/core/functional.js:117
Methodescape
({ content })
lib/tokenizers/bpe-tokenizer.js:31
FunctionflashAttention
(q, k, v, masked)
lib/core/functional.js:137
Methodforward
(x)
lib/core/layers.js:20
Methodforward
(x)
lib/core/layers.js:39
Methodforward
(x)
lib/core/layers.js:63
Methodforward
(x, state, updates)
lib/llms/rwkv.js:51
Methodforward
(x, [_, prev_x, aa, bb, pp], updates)
lib/llms/rwkv.js:71
Methodforward
(x, [prev_x], updates)
lib/llms/rwkv.js:113
Methodforward
(x, state, updates = [])
lib/llms/gpt-neox.js:13
Methodforward
(x)
lib/llms/gpt-neox.js:33
Methodforward
(x)
lib/llms/gpt-neox.js:58
MethodgetInitialState
(ctx)
lib/llms/rwkv.js:28
MethodgetInitialState
(ctx)
lib/llms/gpt-neox.js:19
MethodloadFromFile
* Load a tokenizer from a file. * @type {<T extends typeof Tokenizer>(this: T, path: string) => InstanceType<T>}
lib/tokenizers/tokenizer.js:15
Functionmatmul
(a, b)
lib/core/functional.js:143
Methodprint
* Print info about the graph.
lib/core/context.js:86
MethodprintObjects
* Print GGML objects
lib/core/context.js:58
Functionrepeat
(a, b)
lib/core/functional.js:127
Methodreset
* Reset the graph.
lib/core/context.js:79
Methodreshape
* Reshape the tensor. * @param {...number} dims * @returns {Tensor}
lib/core/tensor.js:120
Functionrope
(a, n_past, n_rot, mode)
lib/core/functional.js:132
Methodshape
* Tensor shape (in reverse order). * @returns {number[]}
lib/core/tensor.js:24
MethodtoString
* Debug string.
lib/core/tensor.js:186
Methodtranspose
* Transpose the tensor. * @returns {Tensor}
lib/core/tensor.js:142
Methodtype
* Tensor type. * @returns {string}
lib/core/tensor.js:16
Methodvisit
(obj, prefix)
lib/core/model.js:79