[Chore] Update type annotation of input_ids in model forward (#33063)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2026-01-26 06:02:10 -08:00
committed by GitHub
parent f4a0921c9c
commit dcd80206b7
164 changed files with 243 additions and 241 deletions
+4 -5
View File
@@ -54,12 +54,11 @@ class ModernBertEmbeddings(nn.Module):
input_ids: torch.Tensor,
inputs_embeds: torch.Tensor | None = None,
) -> torch.Tensor:
if inputs_embeds is not None:
return self.norm(inputs_embeds)
else:
if inputs_embeds is None:
inputs_embeds = self.tok_embeddings(input_ids)
embeddings = self.norm(inputs_embeds)
return embeddings
embeddings = self.norm(inputs_embeds)
return embeddings
class ModernBertAttention(nn.Module):