Skip to content

fix(classifiers): pass vb.pp("deberta") at DeBERTa model load sites (#2353)#2368

Merged
bug-ops merged 1 commit intomainfrom
2353-pii-ner-deberta-prefix
Mar 28, 2026
Merged

fix(classifiers): pass vb.pp("deberta") at DeBERTa model load sites (#2353)#2368
bug-ops merged 1 commit intomainfrom
2353-pii-ner-deberta-prefix

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 28, 2026

Summary

  • PII NER (piiranha-v1) and injection classifier (deberta-v3-small-prompt-injection-v2) fail to load because HuggingFace safetensors store backbone weights under deberta.* namespace, but the code passed a bare VarBuilder expecting no prefix
  • Fix: pass vb.pp("deberta") at all three DebertaV2*Model::load call sites in crates/zeph-llm/src/classifier/
  • Classifier/pooler head layers use vb.root() internally and are unaffected

Changes

  • crates/zeph-llm/src/classifier/ner.rsDebertaV2NERModel::load(vb.pp("deberta"), ...)
  • crates/zeph-llm/src/classifier/candle_pii.rsDebertaV2NERModel::load(vb.pp("deberta"), ...)
  • crates/zeph-llm/src/classifier/candle.rsDebertaV2SeqClassificationModel::load(vb.pp("deberta"), ...)
  • CHANGELOG.md — fix entry under [Unreleased]

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --features candle,metal -p zeph-llm -- -D warnings passes
  • cargo nextest run --features candle,metal -p zeph-llm --lib --bins — 833/833 passed
  • Security audit: no unsafe code, no new attack surface, no new deps
  • Code review approved

Closes #2353

@github-actions github-actions bot added documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) rust Rust code changes bug Something isn't working size/XS Extra small PR (1-10 lines) labels Mar 28, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 28, 2026 18:05
@bug-ops bug-ops force-pushed the 2353-pii-ner-deberta-prefix branch 2 times, most recently from fd7b588 to 86e287e Compare March 28, 2026 18:14
…2353)

Both piiranha-v1 and deberta-v3-small-prompt-injection-v2 store backbone weights
under deberta.* in their safetensors files. Loading with a root VarBuilder caused
tensor-not-found errors, preventing PII NER and injection classifiers from loading.
@bug-ops bug-ops force-pushed the 2353-pii-ner-deberta-prefix branch from 86e287e to 75b41d4 Compare March 28, 2026 18:35
@github-actions github-actions bot added memory zeph-memory crate (SQLite) size/S Small PR (11-50 lines) and removed size/XS Extra small PR (1-10 lines) labels Mar 28, 2026
@bug-ops bug-ops merged commit d31016b into main Mar 28, 2026
25 checks passed
@bug-ops bug-ops deleted the 2353-pii-ner-deberta-prefix branch March 28, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) memory zeph-memory crate (SQLite) rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(classifiers): PII NER (piiranha-v1) never loads — DeBERTa tensor naming mismatch (deberta. prefix)

1 participant