manbeast3b commited on
Commit
b3452b7
·
verified ·
1 Parent(s): 162c7fd

Update src/pipeline.py

Browse files
Files changed (1) hide show
  1. src/pipeline.py +1 -1
src/pipeline.py CHANGED
@@ -50,7 +50,7 @@ class W8A16LinearLayer(nn.Module):
50
  def replace_linear_with_target_and_quantize(module, target_class, module_name_to_exclude):
51
  # with open("/root/.cache/huggingface/hub/output_layers.txt", "a") as f:
52
  for name, child in module.named_children():
53
- if isinstance(child, nn.Linear) and ( 'add_k_proj' in name or 'add_v_proj' in name or 'add_q_proj' in name): #and not any([x == name for x in module_name_to_exclude]): 'linear' in name or
54
  old_bias = child.bias
55
  old_weight = child.weight
56
  new_module = target_class(child.in_features, child.out_features, old_bias is not None, child.weight.dtype)
 
50
  def replace_linear_with_target_and_quantize(module, target_class, module_name_to_exclude):
51
  # with open("/root/.cache/huggingface/hub/output_layers.txt", "a") as f:
52
  for name, child in module.named_children():
53
+ if isinstance(child, nn.Linear) and ( 'linear_1' in name or 'linear_2' in name ): #and not any([x == name for x in module_name_to_exclude]): 'linear' in name or
54
  old_bias = child.bias
55
  old_weight = child.weight
56
  new_module = target_class(child.in_features, child.out_features, old_bias is not None, child.weight.dtype)