Skip to content

Commit

Permalink
Cast rotary embedding dim to int
Browse files Browse the repository at this point in the history
  • Loading branch information
kunal-vaishnavi authored Apr 1, 2024
1 parent 38bd79a commit 9d151ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/python/py/models/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ def __init__(self, config, io_dtype, onnx_dtype, ep, cache_dir, extra_options):
# self.input_shapes["position_ids"] = [1] # Note: This is optional and only needed if you want position_ids to be an int instead of a 2D tensor
self.layernorm_attrs["simple"] = False
self.rotemb_attrs["num_heads"] = self.num_attn_heads
self.rotemb_attrs["rotary_embedding_dim"] = self.head_size * self.rotemb_attrs["partial_rotary_factor"]
self.rotemb_attrs["rotary_embedding_dim"] = int(self.head_size * self.rotemb_attrs["partial_rotary_factor"])

def make_rotary_embedding(self, rotemb, name, root_input, **kwargs):
super().make_rotary_embedding(rotemb, name, root_input, num_heads=self.rotemb_attrs["num_heads"], rotary_embedding_dim=self.rotemb_attrs["rotary_embedding_dim"], **kwargs)
Expand Down

0 comments on commit 9d151ca

Please sign in to comment.