Skip to content

Commit edf1a35

Browse files
committed
Util function to get byte size of MM embeddings object
1 parent 254e76b commit edf1a35

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

exllamav2/generator/dynamic_embeddings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,6 @@ def get_ids(self):
9999

100100
def get_vision_token_range(self):
101101
return self.first_index + self.pre_tokens, self.first_index + self.length - self.post_tokens
102+
103+
def get_size_in_bytes(self):
104+
return self.embeddings.element_size() * self.embeddings.numel()

0 commit comments

Comments
 (0)