Skip to content

Commit

Permalink
feat: expose ubatch param
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Jan 11, 2025
1 parent 00bb6a0 commit c571221
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type LlamaModelOptions = {
pooling_type?: number
n_ctx?: number
n_batch?: number
n_ubatch?: number
n_threads?: number
n_gpu_layers?: number
use_mlock?: boolean
Expand Down
1 change: 1 addition & 0 deletions src/LlamaContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ LlamaContext::LlamaContext(const Napi::CallbackInfo &info)

params.n_ctx = get_option<int32_t>(options, "n_ctx", 512);
params.n_batch = get_option<int32_t>(options, "n_batch", 2048);
params.n_ubatch = get_option<int32_t>(options, "n_ubatch", 512);
params.embedding = get_option<bool>(options, "embedding", false);
if (params.embedding) {
// For non-causal models, batch size must be equal to ubatch size
Expand Down

0 comments on commit c571221

Please sign in to comment.