| from __future__ import annotations | |
| import torch | |
| import torch.nn as nn | |
| class SpecProjector(nn.Module): | |
| def __init__(self, input_dim: int = 768, llm_dim: int = 4096): | |
| super().__init__() | |
| self.net = nn.Sequential( | |
| nn.Linear(input_dim, llm_dim), | |
| nn.GELU(), | |
| nn.Linear(llm_dim, llm_dim), | |
| ) | |
| def forward(self, x: torch.Tensor) -> torch.Tensor: | |
| return self.net(x) | |