Julenmendieta/milab 6494 support more embedding models#3
Merged
julenmendieta merged 6 commits intoJul 3, 2026
Merged
Conversation
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Greptile Summary
This PR extends the Sequence Embeddings block from a single universal model (ESM-2) to a multi-model architecture, adding six specialist protein language models (CurrAb, AbLang2, VHHBERT, H3BERTa, TCR-BERT, PeptideCLM-2) with per-scope model selection via a new card-based UI. The data model migrates from a flat scope list with a global fidelity to per-card
(scope × model)tasks (BlockDataV1 → V2), with a migration path that preserves ESM-2 for all existing projects.model/src/compat.ts): New single source of truth for model specs, scope↔model compatibility filtering (compatibleModels,compatibleScopes,isCompatible) and specialist-first recommendation logic (recommendedModel). Scopes gainisHeavy+receptorsnapshots so the args lambda stays data-only.models.lib.tengo,main.tpl.tengo,compute-embeddings.tpl.tengo): Central Tengo registry mirrors the TS catalog; per-task model routing usesresolveModelTag;isHeavypropagates to the Python step for AbLang2's heavy/light slot selection.main.py): AddsAbLang2Embedder, per-model input transforms (prepare_sequence), multi-family model loading (hf,hf-custom,ablang2), and per-model layer/pooling configuration controlled by--emb-layerand--pool-special-tokens.Confidence Score: 3/5
The core multi-model architecture is well-designed, but CurrAb embeddings will be extracted from the wrong transformer layer (last vs. penultimate) until the registry discrepancy is resolved.
The CurrAb embLayer value in the Tengo registry (-1, last layer) directly contradicts the Python code's explicit statement that CurrAb uses penultimate (-2), and the workflow always overrides the Python default with the registry value. This means every CurrAb embedding run will silently use the wrong hidden layer. The rest of the architecture — the V1→V2 migration, scope compatibility logic, AbLang2 heavy/light slot routing, and the new card-based UI — is solid.
workflow/src/models.lib.tengo (CurrAb embLayer value) and ui/src/pages/EmbeddingCard.vue (sequence dropdown not filtered when model is chosen first)
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD UI["EmbeddingCard UI\n(scope × model dropdowns)"] -->|writes EmbeddingCard| BD["BlockDataV2\n(embeddings: EmbeddingCard[])"] BD -->|args lambda| ARGS["BlockArgs\n(embeddings: EmbeddingTask[])"] ARGS -->|wf.body| WF["main.tpl.tengo\n(iterates tasks)"] WF -->|resolveModelTag| MLT["models.lib.tengo\ncentral registry"] MLT --> CE["compute-embeddings.tpl.tengo\n(per batch)"] CE -->|--model-family hf| EMB1["Embedder\n(AutoModel: ESM-2/CurrAb/VHHBERT/H3BERTa/TCR-BERT)"] CE -->|--model-family hf-custom| EMB2["Embedder trust_remote_code\n(PeptideCLM-2)"] CE -->|--model-family ablang2| EMB3["AbLang2Embedder\n(pip model + asset weights)"] EMB1 --> OUT["embeddings_{scope}.parquet\n(long-format: key x dim x value)"] EMB2 --> OUT EMB3 --> OUT COMPAT["model/src/compat.ts\nEMBEDDING_MODELS catalog"] -->|compatibleModels| UI COMPAT -->|isCompatible| ARGS SCOPES["model/src/scopes.ts\nbuildScopeConfig + isHeavy"] -->|ScopeConfig| UI%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD UI["EmbeddingCard UI\n(scope × model dropdowns)"] -->|writes EmbeddingCard| BD["BlockDataV2\n(embeddings: EmbeddingCard[])"] BD -->|args lambda| ARGS["BlockArgs\n(embeddings: EmbeddingTask[])"] ARGS -->|wf.body| WF["main.tpl.tengo\n(iterates tasks)"] WF -->|resolveModelTag| MLT["models.lib.tengo\ncentral registry"] MLT --> CE["compute-embeddings.tpl.tengo\n(per batch)"] CE -->|--model-family hf| EMB1["Embedder\n(AutoModel: ESM-2/CurrAb/VHHBERT/H3BERTa/TCR-BERT)"] CE -->|--model-family hf-custom| EMB2["Embedder trust_remote_code\n(PeptideCLM-2)"] CE -->|--model-family ablang2| EMB3["AbLang2Embedder\n(pip model + asset weights)"] EMB1 --> OUT["embeddings_{scope}.parquet\n(long-format: key x dim x value)"] EMB2 --> OUT EMB3 --> OUT COMPAT["model/src/compat.ts\nEMBEDDING_MODELS catalog"] -->|compatibleModels| UI COMPAT -->|isCompatible| ARGS SCOPES["model/src/scopes.ts\nbuildScopeConfig + isHeavy"] -->|ScopeConfig| UIPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "Changeset" | Re-trigger Greptile
Context used: