Spaces:
Runtime error
Runtime error
Commit
·
cc6ae96
1
Parent(s):
ccbfd85
Update modeling.py
Browse files- modeling.py +8 -0
modeling.py
CHANGED
@@ -3,6 +3,14 @@ import torch
|
|
3 |
import torch.nn as nn
|
4 |
import torch.nn.functional as F
|
5 |
from dataclasses import dataclass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
@dataclass
|
8 |
class VisualEncoderConfig:
|
|
|
3 |
import torch.nn as nn
|
4 |
import torch.nn.functional as F
|
5 |
from dataclasses import dataclass
|
6 |
+
from rwkv.model import RWKV
|
7 |
+
|
8 |
+
class UpdatableRWKV(RWKV):
|
9 |
+
def __init__(self, *args, **kwargs):
|
10 |
+
super().__init__(*args, **kwargs)
|
11 |
+
|
12 |
+
def update_emb_weight(self, new_value):
|
13 |
+
self.w["emb.weight"] = new_value
|
14 |
|
15 |
@dataclass
|
16 |
class VisualEncoderConfig:
|