@@ -50,7 +50,7 @@ class Llama4UnfoldConvolution(nnx.Module):
5050 config: Config containing model parameters
5151 """
5252
53- def __init__ (self , config : Config , * , rngs : nnx .Rngs = None ):
53+ def __init__ (self , config : Config , * , rngs : nnx .Rngs = None ): # pyrefly: ignore[bad-function-definition]
5454 self .config = config
5555 self .rngs = rngs
5656 self .vit_unfold_linear = linears .DenseGeneral (
@@ -123,7 +123,7 @@ class Llama4VisionMLP(nnx.Module):
123123 config: Config containing model parameters
124124 """
125125
126- def __init__ (self , config : Config , * , rngs : nnx .Rngs = None ):
126+ def __init__ (self , config : Config , * , rngs : nnx .Rngs = None ): # pyrefly: ignore[bad-function-definition]
127127 self .config = config
128128 self .rngs = rngs
129129 self .vit_encoder_layer_mlp_fc1 = linears .DenseGeneral (
@@ -157,7 +157,7 @@ class Llama4VisionMLP2(nnx.Module):
157157 config: Config containing model parameters
158158 """
159159
160- def __init__ (self , config : Config , * , rngs : nnx .Rngs = None ):
160+ def __init__ (self , config : Config , * , rngs : nnx .Rngs = None ): # pyrefly: ignore[bad-function-definition]
161161 self .config = config
162162 self .rngs = rngs
163163 self .vit_pixel_shuffle_mlp_fc1 = linears .DenseGeneral (
@@ -196,7 +196,7 @@ class Llama4VisionPixelShuffleMLP(nnx.Module):
196196 config: Config containing model parameters
197197 """
198198
199- def __init__ (self , config : Config , * , rngs : nnx .Rngs = None ):
199+ def __init__ (self , config : Config , * , rngs : nnx .Rngs = None ): # pyrefly: ignore[bad-function-definition]
200200 self .config = config
201201 self .rngs = rngs
202202 self .pixel_shuffle_ratio = self .config .pixel_shuffle_ratio_for_vit
@@ -221,7 +221,7 @@ class Llama4MultiModalProjector(nnx.Module):
221221 config: Config containing model parameters
222222 """
223223
224- def __init__ (self , config : Config , mesh : Mesh , * , rngs : nnx .Rngs = None ):
224+ def __init__ (self , config : Config , mesh : Mesh , * , rngs : nnx .Rngs = None ): # pyrefly: ignore[bad-function-definition]
225225 self .config = config
226226 self .mesh = mesh
227227 self .rngs = rngs
@@ -515,8 +515,8 @@ def update_cache(cache, val):
515515 return cache .at [layer_idx ].set (val )
516516 return cache
517517
518- stacked_kv_cache = jax .tree_util .tree_map (update_cache , stacked_kv_cache , kv_cache )
519- return (layer_output , stacked_kv_cache , layer_idx + 1 ), None
518+ stacked_kv_cache = jax .tree_util .tree_map (update_cache , stacked_kv_cache , kv_cache ) # pyrefly: ignore[unbound-name]
519+ return (layer_output , stacked_kv_cache , layer_idx + 1 ), None # pyrefly: ignore[unbound-name]
520520 elif cfg .scan_layers :
521521 return layer_output , None
522522 else :
@@ -623,7 +623,7 @@ def __call__(
623623class Llama4VisionEncoderLayer (nnx .Module ):
624624 """Transformer encoder layer for Llama4 vision model."""
625625
626- def __init__ (self , config : Config , mesh : Mesh , * , rngs : nnx .Rngs = None ):
626+ def __init__ (self , config : Config , mesh : Mesh , * , rngs : nnx .Rngs = None ): # pyrefly: ignore[bad-function-definition]
627627 self .config = config
628628 self .mesh = mesh
629629 self .rngs = rngs
@@ -701,7 +701,7 @@ class Llama4VisionEncoder(nnx.Module):
701701 mesh: Mesh, JAX device mesh (used for sharding)
702702 """
703703
704- def __init__ (self , config : Config , mesh : Mesh , * , rngs : nnx .Rngs = None ):
704+ def __init__ (self , config : Config , mesh : Mesh , * , rngs : nnx .Rngs = None ): # pyrefly: ignore[bad-function-definition]
705705 self .config = config
706706 self .mesh = mesh
707707 self .rngs = rngs
@@ -733,7 +733,7 @@ class Llama4VisionModel(nnx.Module):
733733 mesh: Mesh, JAX device mesh (used for sharding)
734734 """
735735
736- def __init__ (self , config : Config , mesh : Mesh , * , rngs : nnx .Rngs = None ):
736+ def __init__ (self , config : Config , mesh : Mesh , * , rngs : nnx .Rngs = None ): # pyrefly: ignore[bad-function-definition]
737737 self .config = config
738738 self .mesh = mesh
739739 self .rngs = rngs
0 commit comments