5 Commits
Author SHA1 Message Date
guofangandClaude Sonnet 5.5 db8e536254 Read model parameters from the model instead of hard-coding
MODELS is now a list: a short recommended set plus sentence-transformers
models found in the Hugging Face cache, refreshed on startup, /lsmod and
/select. Defaults are read on first load: pooling from 1_Pooling/config.json,
max_length from the model and tokenizer limits (capped at 8192), batch_size
from the parameter count, and dtype from the model config. Also recognize
sharded weights in is_cached.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 22:33:02 +08:00
guofangandClaude Sonnet 5.5 2f59bddba0 Show readable tokens for byte-level BPE tokenizers
Qwen tokens were printed as raw byte characters (e.g. 你好 as ä½łå¥½).
Decode each token for byte-level tokenizers, keeping the raw form for
tokens that hold only part of a multi-byte character.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 22:19:56 +08:00
guofangandClaude Sonnet 5.5 0cb17d6638 Add Qwen3-Embedding-8B and last-token pooling
Qwen3-Embedding is a decoder model: it pools the last token, so add a
"last" pooling mode, pad on the left, and load the weights in bfloat16.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 22:16:50 +08:00
guofangandClaude Sonnet 5.5 30d7be1a80 Use the Apple Silicon GPU when available
Pick cuda, then mps, then cpu.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 22:16:50 +08:00
guofangandClaude Sonnet 5.5 822b55f26f Complete while typing with prompt_toolkit
Replace readline with a prompt_toolkit session: the completion menu opens
as you type, history suggestions show in gray (accept with Right), and
history lives in .cache/history. Enter on a highlighted candidate accepts
it instead of submitting the line. Ctrl+C now exits cleanly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 22:16:50 +08:00