3
3
import pytest
4
4
import torch
5
5
6
- from vllm .multimodal .inputs import MultiModalKwargs , PlaceholderRange
6
+ from vllm .multimodal .inputs import MultiModalKwargs
7
7
from vllm .sampling_params import SamplingParams
8
8
from vllm .utils import sha256
9
9
# disable yapf here as it formats differently than isort such that both fail
@@ -158,10 +158,13 @@ def test_generate_block_hash_extra_keys():
158
158
request = make_request (
159
159
request_id = 0 ,
160
160
prompt_token_ids = [_ for _ in range (20 )],
161
- mm_positions = [
162
- PlaceholderRange (offset = 0 , length = 5 ),
163
- PlaceholderRange (offset = 10 , length = 5 ),
164
- ],
161
+ mm_positions = [{
162
+ "offset" : 0 ,
163
+ "length" : 5
164
+ }, {
165
+ "offset" : 10 ,
166
+ "length" : 5
167
+ }],
165
168
mm_hashes = ["hash1" , "hash2" ],
166
169
)
167
170
@@ -219,10 +222,13 @@ def test_hash_request_tokens(hash_fn):
219
222
request = make_request (
220
223
request_id = 0 ,
221
224
prompt_token_ids = [_ for _ in range (6 )],
222
- mm_positions = [
223
- PlaceholderRange (offset = 0 , length = 3 ),
224
- PlaceholderRange (offset = 3 , length = 3 ),
225
- ],
225
+ mm_positions = [{
226
+ "offset" : 0 ,
227
+ "length" : 3
228
+ }, {
229
+ "offset" : 3 ,
230
+ "length" : 3
231
+ }],
226
232
mm_hashes = ["hash1" , "hash2" ],
227
233
)
228
234
@@ -247,19 +253,25 @@ def test_hash_tokens_different_mm_input(hash_fn):
247
253
request1 = make_request (
248
254
request_id = 0 ,
249
255
prompt_token_ids = [_ for _ in range (6 )],
250
- mm_positions = [
251
- PlaceholderRange (offset = 0 , length = 3 ),
252
- PlaceholderRange (offset = 3 , length = 3 ),
253
- ],
256
+ mm_positions = [{
257
+ "offset" : 0 ,
258
+ "length" : 3
259
+ }, {
260
+ "offset" : 3 ,
261
+ "length" : 3
262
+ }],
254
263
mm_hashes = ["hash1" , "hash2" ],
255
264
)
256
265
request2 = make_request (
257
266
request_id = 1 ,
258
267
prompt_token_ids = [_ for _ in range (6 )],
259
- mm_positions = [
260
- PlaceholderRange (offset = 0 , length = 3 ),
261
- PlaceholderRange (offset = 3 , length = 3 ),
262
- ],
268
+ mm_positions = [{
269
+ "offset" : 0 ,
270
+ "length" : 3
271
+ }, {
272
+ "offset" : 3 ,
273
+ "length" : 3
274
+ }],
263
275
mm_hashes = ["hash3" , "hash2" ],
264
276
)
265
277
block_size = 3
0 commit comments