You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: optimize vision token detection using torch.isin
Implement efficiency improvements suggested by DarkLight1337:
- Consolidate get_pooling_params method for "embed" and "encode" tasks
- Pre-compute vision token IDs tensor in constructor
- Replace range checks with torch.isin for more efficient vision token detection
at lines 209-210 and 261-262
This reduces redundant code and improves performance when checking for
vision tokens by using optimized tensor operations.
Signed-off-by: Sigrid Jin (Sionic AI) <sigrid@sionic.ai>
0 commit comments