• Stefy Lanza (nextime / spora )'s avatar
    embeddings: chunk against the model's REAL window, and report it everywhere (v0.3.74) · bd855536
    Stefy Lanza (nextime / spora ) authored
    Two gaps in 0.3.72/73, both of which left chunking looking enabled while doing
    nothing useful.
    
    THE THRESHOLD WAS A NUMBER SOMEONE TYPED.
    
        max_len = int(_emb_cfg.get('n_ctx') or _raw.get('n_ctx') or 8192)
    
    Set n_ctx above what the model accepts and the windows are built too big; the
    tokenizer then truncates each window at its real limit anyway and chunking
    silently stops protecting anything -- the same invisible loss this code exists
    to remove, reached through a config typo instead of a missing feature. The
    window is now min(configured, tokenizer.model_max_length), with one trap
    handled: HuggingFace sets model_max_length to a sentinel near 1e30 when the
    checkpoint declares none, and believing that means never chunking at all, so a
    value that large is read as "unknown" and the caller's number stands. Same clamp
    on the sentence-transformers path, taking the smaller of max_seq_length and the
    tokenizer's own limit.
    
    THE MULTI-VECTOR PATH COLLECTED THE COUNTS AND DROPPED THEM. It builds its own
    response, so the dense path's report did not cover it -- chunking was invisible
    on exactly the path that needs it most, which is the bug this feature was
    written to fix. It now reports
    
        "chunked": {"windows": [...], "pool": ..., "token_limit": N}
    
    and logs the limit with the merges applied. `token_limit` is deliberate: it is
    what makes a WRONG n_ctx visible rather than merely ineffective.
    
    46 tests. Suite at the 25 pre-existing failures.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01HXRMe9ZPUQCCCtBai9uqt3
    bd855536
Name
Last commit
Last update
..
__init__.py Loading commit data...
_film_net.py Loading commit data...
_rife_ifnet.py Loading commit data...
app.py Loading commit data...
archive.py Loading commit data...
audio_backends.py Loading commit data...
audio_clean.py Loading commit data...
audio_gen.py Loading commit data...
audio_stems.py Loading commit data...
audiocraft_worker.py Loading commit data...
canary_worker.py Loading commit data...
characters.py Loading commit data...
colibri_worker.py Loading commit data...
compose.py Loading commit data...
crisperwhisper_worker.py Loading commit data...
custom_pipelines.py Loading commit data...
diarization.py Loading commit data...
ds4_kv_janitor.py Loading commit data...
ds4_worker.py Loading commit data...
embeddings.py Loading commit data...
environments.py Loading commit data...
faceswap.py Loading commit data...
fastlog.py Loading commit data...
h3_worker.py Loading commit data...
host_worker.py Loading commit data...
hub_compat.py Loading commit data...
images.py Loading commit data...
k3_worker.py Loading commit data...
kt_worker.py Loading commit data...
lipsync.py Loading commit data...
log.py Loading commit data...
longcat_worker.py Loading commit data...
lora_archs.py Loading commit data...
loras.py Loading commit data...
melotts_worker.py Loading commit data...
model_test.py Loading commit data...
models_transfer.py Loading commit data...
mux_remote.py Loading commit data...
ocr.py Loading commit data...
parler_worker.py Loading commit data...
pipelines.py Loading commit data...
pod_http.py Loading commit data...
pod_tls.py Loading commit data...
podlog.py Loading commit data...
prompt_cache.py Loading commit data...
pyannote_worker.py Loading commit data...
ratelimit.py Loading commit data...
remote_gateway.py Loading commit data...
rerank.py Loading commit data...
runpod_client.py Loading commit data...
runpod_ledger.py Loading commit data...
runpod_worker.py Loading commit data...
spatial.py Loading commit data...
speaker_embeddings.py Loading commit data...
speaker_registry.py Loading commit data...
state.py Loading commit data...
stt_backends.py Loading commit data...
text.py Loading commit data...
transcriptions.py Loading commit data...
tts.py Loading commit data...
tts_backends.py Loading commit data...
uploads.py Loading commit data...
urlutils.py Loading commit data...
video.py Loading commit data...
vllm_worker.py Loading commit data...
voice_clone.py Loading commit data...
voice_convert.py Loading commit data...
vpr_salad_server.py Loading commit data...
xtts_worker.py Loading commit data...