[Bugfix] Fix LM detection for Nemotron Parse (#42641)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2026-05-14 23:42:10 +08:00
committed by GitHub
parent f07b1da797
commit b8a25d0e12
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -207,7 +207,8 @@ class SupportsMultiModal(Protocol):
raise NotImplementedError(
f"No language model found in {type(self).__name__}! "
"You should initialize it via `_mark_language_model`."
"You should initialize it via `_mark_language_model`, "
"and make sure `embed_input_ids` is implemented."
)
@contextmanager
@@ -281,6 +281,9 @@ class MBartDecoderNoPos(nn.Module):
self.layernorm_embedding = nn.LayerNorm(config.d_model)
self.layer_norm = nn.LayerNorm(config.d_model)
def embed_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor:
return self.embed_tokens(input_ids)
def forward(
self,
decoder_input_ids: torch.Tensor | None,