-
Notifications
You must be signed in to change notification settings - Fork 59
[docs] add docs to src/llama.ts
#182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThis change adds comprehensive JSDoc comments to the interfaces Changes
Assessment against linked issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/wllama.ts (1)
157-161
: Typo: stray double-quote in JSDocThere’s an extra double-quote at the end of the description line for
rope_freq_base
.Apply this diff to remove it:
- * Rotary Position Embeddings (RoPE) base frequency, used by NTK-aware scaling (default: loaded from model)" + * Rotary Position Embeddings (RoPE) base frequency, used by NTK-aware scaling (default: loaded from model)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (1)
src/wllama.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: GitGuardian Security Checks
🔇 Additional comments (8)
src/wllama.ts (8)
79-87
: Well-documented chat message interfaceThe JSDoc for
WllamaChatMessage
clearly describes bothrole
andcontent
, matching the type definitions.
90-98
: Clear assets path configuration docsThe documentation for
'single-thread/wllama.wasm'
and'multi-thread/wllama.wasm'
is precise and explains the optional nature of the multi-thread path.
100-156
: Comprehensive LoadModelConfig defaultsThe JSDoc blocks for
seed
,n_ctx
,n_batch
,n_threads
,embeddings
,offload_kqv
,pooling_type
, andrope_scaling_type
accurately describe their purpose and default values.
163-168
: Correct RoPE context scaling docsThe JSDoc for
rope_freq_scale
correctly states its purpose and default.
169-180
: YaRN extrapolation and attention factors documentedThe
yarn_ext_factor
andyarn_attn_factor
descriptions and default values are clear and consistent.
182-192
: YaRN correction factors docs look goodThe JSDoc for
yarn_beta_fast
andyarn_beta_slow
correctly explains their roles and defaults.
194-199
: Original context size documentation is accurate
yarn_orig_ctx
is well-documented, indicating its default is loaded from the model.
202-212
: KV cache data type documentation is clearThe JSDoc for
cache_type_k
andcache_type_v
concisely describes the options and defaults.
/** | ||
* Offload the KQV ops (including the KV cache) to GPU | ||
* | ||
* @defaultValue false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in Llama.cpp, the default value is true. But since Wllama runs only on CPU, i supposed that the default value is false
Fix #181
add docs for the following interfaces:
LoadModelConfig
AssetsPathConfig
WllamaChatMessage
SamplingConfig
CompletionChunk
WIP
Summary by CodeRabbit