ynhe commited on
Commit
4fbb18f
1 Parent(s): 03696bd

Update models/eva_vit.py

Browse files
Files changed (1) hide show
  1. models/eva_vit.py +1 -5
models/eva_vit.py CHANGED
@@ -523,11 +523,7 @@ def convert_weights_to_fp16(model: nn.Module):
523
  l.weight.data = l.weight.data.half()
524
  if l.bias is not None:
525
  l.bias.data = l.bias.data.half()
526
- if isinstance(l, (nn.MultiheadAttention, Attention)):
527
- for attr in [*[f"{s}_proj_weight" for s in ["in", "q", "k", "v"]], "in_proj_bias", "bias_k", "bias_v"]:
528
- tensor = getattr(l, attr)
529
- if tensor is not None:
530
- tensor.data = tensor.data.half()
531
  model.apply(_convert_weights_to_fp16)
532
 
533
 
 
523
  l.weight.data = l.weight.data.half()
524
  if l.bias is not None:
525
  l.bias.data = l.bias.data.half()
526
+
 
 
 
 
527
  model.apply(_convert_weights_to_fp16)
528
 
529