Added Nomic moe v2 embedding model class definition and hf conversion for it #162
+234
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Nomic Embedding Model Support
Summary
Adds foundational support for Nomic BERT embedding models (e.g., nomic-embed-text-v2-moe)
with weight loading and HuggingFace conversion. Model architecture is defined but forward
pass implementation is deferred to future PRs.
Key Changes
Model Architecture
NomicModel
class with weight loading for:Configuration
num_experts
,num_shared_experts
,num_top_experts
,moe_every_n_layers
ModelType::NOMIC
enum and factory supportHuggingFace Conversion
convert_hf.py
for Nomic BERT models:AutoModel
for non-causal modelsFiles Changed
cactus/models/model.h
(+62 lines)cactus/models/model_nomic.cpp
(+82 lines, new)cactus/engine/engine.h
(+6 lines)cactus/engine/engine_model.cpp
(+7 lines)tools/convert_hf.py
(+110/-22 lines)Next Steps
Add operation and kernel updates in
origin/moe-ops-for-nomic-embed
and forward pass implementation is complete on theimplemented-nomic-model
branch