File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change
1
+ from typing import Dict , List , Tuple
2
+
1
3
import torch
2
4
import torch .nn as nn
3
- from transformers import BertModel , BertTokenizer , BertConfig
4
5
import torch .nn .functional as F
5
- from typing import Tuple , List , Dict
6
+ from transformers import BertConfig , BertModel , BertTokenizer
6
7
7
8
8
9
# Sample Pool Model (for testing plugin serialization)
@@ -180,10 +181,12 @@ def BertModule():
180
181
num_hidden_layers = 12 ,
181
182
num_attention_heads = 12 ,
182
183
intermediate_size = 3072 ,
184
+ use_cache = False ,
185
+ output_attentions = False ,
186
+ output_hidden_states = False ,
183
187
torchscript = True ,
184
188
)
185
- model = BertModel ( config )
189
+ model = BertModel . from_pretrained ( model_name , config = config )
186
190
model .eval ()
187
- model = BertModel .from_pretrained (model_name , torchscript = True )
188
191
traced_model = torch .jit .trace (model , [tokens_tensor , segments_tensors ])
189
192
return traced_model
Original file line number Diff line number Diff line change 1
1
timm == v0.9.2
2
- transformers == 4.30.0
2
+ transformers == 4.33.2
3
3
torchvision
You can’t perform that action at this time.
0 commit comments