Yiqin commited on
Commit
e19b610
1 Parent(s): 6ef31de
model/fastchat/serve/compression.py CHANGED
@@ -28,7 +28,7 @@ class CLinear(nn.Module):
28
  def __init__(self, weight, bias, device):
29
  super().__init__()
30
 
31
- self.weight = compress(weight.data.to(device), default_compression_config)
32
  self.bias = bias
33
 
34
  def forward(self, input: Tensor) -> Tensor:
 
28
  def __init__(self, weight, bias, device):
29
  super().__init__()
30
 
31
+ self.weight = compress(weight.detach().to(device), default_compression_config)
32
  self.bias = bias
33
 
34
  def forward(self, input: Tensor) -> Tensor: