[Bugfix] Fix LM detection for Nemotron Parse (#42641)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user