Skip to content

Commit

Permalink
clean up args
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Jul 26, 2023
1 parent 0624d80 commit 97fe4c8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mha.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@
device = torch.device('cuda' if torch.cuda.is_available() else "cpu")


class Args:
def __init__(self):
self.layernorm_eps = 1e-5
self.xpos_rel_pos = False
self.xpos_scale_base = 1.0
self.multiway = True
args = Args()

#initialize attention
attention = MultiheadAttention(
args,
embed_dim=1024,
num_heads=8,
dropout=0.0,
Expand Down

0 comments on commit 97fe4c8

Please sign in to comment.