Skip to content

Commit

Permalink
Add feature dim attributes to BitLinear for easier PEFT integration (#…
Browse files Browse the repository at this point in the history
…34946)

Update bitnet.py, extremely small change to allow for easier PEFT integration

Co-authored-by: Mohamed Mekkouri <[email protected]>
  • Loading branch information
agostinv and MekkCyber authored Dec 6, 2024
1 parent 9ad4c93 commit 7f95372
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transformers/integrations/bitnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class BitLinear(nn.Module):
def __init__(self, in_features: int, out_features: int, bias: bool, device=None, dtype=None):
super().__init__()
self.dtype = dtype
self.in_features = in_features
self.out_features = out_features
self.register_buffer(
"weight",
torch.zeros(
Expand Down

0 comments on commit 7f95372

Please sign in to comment.