[Mypy] Fix mypy typing for N/O models (#54142)

Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
This commit is contained in:
Taneem Ibrahim
2026-09-18 12:50:01 +01:00
committed by GitHub
parent e562003adb
commit 2b8a5495a8
19 changed files with 321 additions and 143 deletions
+2
View File
@@ -218,6 +218,7 @@ class OPTDecoder(nn.Module):
)
# Project out & in will be replicated if they exist.
self.project_out: ReplicatedLinear | None
if config.word_embed_proj_dim != config.hidden_size:
self.project_out = ReplicatedLinear(
config.hidden_size,
@@ -229,6 +230,7 @@ class OPTDecoder(nn.Module):
else:
self.project_out = None
self.project_in: ReplicatedLinear | None
if config.word_embed_proj_dim != config.hidden_size:
self.project_in = ReplicatedLinear(
config.word_embed_proj_dim,