fix AttributeError: 'MoonViT3dEncoder' object has no attribute 'use_deterministic_attn'
Browse files- modeling_kimi_k25.py +3 -2
modeling_kimi_k25.py
CHANGED
|
@@ -562,7 +562,8 @@ class MoonViT3dEncoder(nn.Module):
|
|
| 562 |
hidden_dim: int,
|
| 563 |
num_layers: int,
|
| 564 |
block_cfg: dict,
|
| 565 |
-
video_attn_type: str = 'spatial_temporal'
|
|
|
|
| 566 |
super().__init__()
|
| 567 |
|
| 568 |
assert video_attn_type == 'spatial_temporal', f'video_attn_type must be "spatial_temporal", got {video_attn_type}'
|
|
@@ -572,7 +573,7 @@ class MoonViT3dEncoder(nn.Module):
|
|
| 572 |
self.blocks = nn.ModuleList([
|
| 573 |
MoonViTEncoderLayer(
|
| 574 |
**block_cfg,
|
| 575 |
-
use_deterministic_attn=
|
| 576 |
for _ in range(num_layers)
|
| 577 |
])
|
| 578 |
self.final_layernorm = nn.LayerNorm(hidden_dim)
|
|
|
|
| 562 |
hidden_dim: int,
|
| 563 |
num_layers: int,
|
| 564 |
block_cfg: dict,
|
| 565 |
+
video_attn_type: str = 'spatial_temporal',
|
| 566 |
+
use_deterministic_attn: bool = False) -> None:
|
| 567 |
super().__init__()
|
| 568 |
|
| 569 |
assert video_attn_type == 'spatial_temporal', f'video_attn_type must be "spatial_temporal", got {video_attn_type}'
|
|
|
|
| 573 |
self.blocks = nn.ModuleList([
|
| 574 |
MoonViTEncoderLayer(
|
| 575 |
**block_cfg,
|
| 576 |
+
use_deterministic_attn=use_deterministic_attn)
|
| 577 |
for _ in range(num_layers)
|
| 578 |
])
|
| 579 |
self.final_layernorm = nn.LayerNorm(hidden_dim)
|