[Minor] fix the style for multimodal models (#2257)

This commit is contained in:
Lianmin Zheng
2024-11-29 04:24:20 -08:00
committed by GitHub
parent f50a6cf443
commit afe1e46586
3 changed files with 14 additions and 12 deletions
+4 -4
View File
@@ -149,8 +149,8 @@ class ImageInputs:
# Use image hash as fake token_ids. We use this as the key for prefix matching in the radix cache.
# Please note that if the `input_ids` is later used in the model forward,
# you also need to clamp the values within the range of [0, vocab_size) to avoid illegal
# cuda memory access.
# you also need to clamp the values within the range of [0, vocab_size) to avoid out-of-bound
# errors in cuda kernels. See also llava.py for example.
ret.pad_values = [x % (1 << 30) for x in ret.image_hashes]
optional_args = [
@@ -172,8 +172,8 @@ class ImageInputs:
# Use image hash as fake token_ids. We use this as the key for prefix matching in the radix cache.
# Please note that if the `input_ids` is later used in the model forward,
# you also need to clamp the values within the range of [0, vocab_size) to avoid illegal
# cuda memory access.
# you also need to clamp the values within the range of [0, vocab_size) to avoid out-of-bound
# errors in cuda kernels. See also llava.py for example.
self.image_hashes += other.image_hashes
self.pad_values = [x % (1 << 30) for x in self.image_hashes]