Update modeling_tta.py
Browse files- modeling_tta.py +3 -3
modeling_tta.py
CHANGED
|
@@ -49,7 +49,7 @@ def get_hadamard_matrix(d: int, dtype=torch.float32) -> torch.Tensor:
|
|
| 49 |
return ortho.contiguous()
|
| 50 |
|
| 51 |
class HadamardMLP(nn.Module):
|
| 52 |
-
def __init__(self, config:
|
| 53 |
super().__init__()
|
| 54 |
self.dim = config.hidden_size
|
| 55 |
self.scale1 = nn.Parameter(torch.ones(self.dim))
|
|
@@ -68,7 +68,7 @@ class HadamardMLP(nn.Module):
|
|
| 68 |
return out
|
| 69 |
|
| 70 |
class SwiGLUMLP(nn.Module):
|
| 71 |
-
def __init__(self, config:
|
| 72 |
super().__init__()
|
| 73 |
self.gate_proj = nn.Linear(config.hidden_size, config.intermediate_size, bias=False)
|
| 74 |
self.up_proj = nn.Linear(config.hidden_size, config.intermediate_size, bias=False)
|
|
@@ -78,7 +78,7 @@ class SwiGLUMLP(nn.Module):
|
|
| 78 |
return self.down_proj(F.silu(self.gate_proj(x)) * self.up_proj(x))
|
| 79 |
|
| 80 |
class EngramMemory(nn.Module):
|
| 81 |
-
def __init__(self, config:
|
| 82 |
super().__init__()
|
| 83 |
self.dim = config.hidden_size
|
| 84 |
self.num_entries = config.engram_entries
|
|
|
|
| 49 |
return ortho.contiguous()
|
| 50 |
|
| 51 |
class HadamardMLP(nn.Module):
|
| 52 |
+
def __init__(self, config: TTAConfig):
|
| 53 |
super().__init__()
|
| 54 |
self.dim = config.hidden_size
|
| 55 |
self.scale1 = nn.Parameter(torch.ones(self.dim))
|
|
|
|
| 68 |
return out
|
| 69 |
|
| 70 |
class SwiGLUMLP(nn.Module):
|
| 71 |
+
def __init__(self, config: TTAConfig):
|
| 72 |
super().__init__()
|
| 73 |
self.gate_proj = nn.Linear(config.hidden_size, config.intermediate_size, bias=False)
|
| 74 |
self.up_proj = nn.Linear(config.hidden_size, config.intermediate_size, bias=False)
|
|
|
|
| 78 |
return self.down_proj(F.silu(self.gate_proj(x)) * self.up_proj(x))
|
| 79 |
|
| 80 |
class EngramMemory(nn.Module):
|
| 81 |
+
def __init__(self, config: TTAConfig):
|
| 82 |
super().__init__()
|
| 83 |
self.dim = config.hidden_size
|
| 84 |
self.num_entries = config.engram_entries
|