Onboard voyage-4-nano (#33720)

Signed-off-by: Chengcheng Pei <chengchengpei@outlook.com>
Signed-off-by: chengchengpei <5881383+chengchengpei@users.noreply.github.com>
Co-authored-by: chengchengpei <5881383+chengchengpei@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
chengchengpei
2026-02-05 22:23:34 -08:00
committed by GitHub
parent 6550815c3a
commit 965525667b
8 changed files with 216 additions and 2 deletions

View File

@@ -1513,6 +1513,10 @@ class ModelConfig:
@property
def embedding_size(self):
# Check for embedding_size set by model config (e.g., Voyage models)
override = getattr(self.hf_config, "embedding_size", None)
if override is not None:
return override
dense_modules = try_get_dense_modules(self.model, revision=self.revision)
if dense_modules is not None:
return dense_modules[-1]["out_features"]