|
4 | 4 | import pytest
|
5 | 5 | import torch
|
6 | 6 |
|
7 |
| -from vllm.model_executor.models.fuyu import FuyuImagePatchInputs |
8 | 7 | from vllm.model_executor.models.glm4_1v import Glm4vImageEmbeddingInputs
|
| 8 | +from vllm.model_executor.models.granite_speech import GraniteSpeechAudioInputs |
9 | 9 | from vllm.model_executor.models.phi3v import Phi3VImagePixelInputs
|
10 | 10 |
|
11 | 11 |
|
@@ -129,23 +129,27 @@ def test_tensor_schema_with_invalid_resolve_binding_dims():
|
129 | 129 |
|
130 | 130 |
|
131 | 131 | def test_tensor_schema_with_list_of_symbolic_dim():
|
132 |
| - flat_data = torch.stack([torch.randn(768) for _ in range(3)]) # (bn=3, fn) |
133 |
| - patches_per_image = [64, 64, 64] # len = bn = 3 |
134 |
| - |
135 |
| - FuyuImagePatchInputs( |
136 |
| - flat_data=flat_data, |
137 |
| - patches_per_image=patches_per_image, |
| 132 | + input_features = torch.randn(3, 10, 160) # (b=3, fi=10, 160) |
| 133 | + input_features_mask = torch.randn(3, 8) # (b=3, fo=8) |
| 134 | + audio_embed_sizes = [8, 8, 8] # len = b = 3 |
| 135 | + |
| 136 | + GraniteSpeechAudioInputs( |
| 137 | + input_features=input_features, |
| 138 | + input_features_mask=input_features_mask, |
| 139 | + audio_embed_sizes=audio_embed_sizes, |
138 | 140 | )
|
139 | 141 |
|
140 | 142 |
|
141 | 143 | def test_tensor_schema_with_list_of_symbolic_dim_mismatch_in_length():
|
142 |
| - flat_data = torch.stack([torch.randn(768) for _ in range(4)]) # (bn=4, fn) |
143 |
| - patches_per_image = [64, 64, 64] # len = 3 ≠ bn |
144 |
| - |
145 |
| - with pytest.raises(ValueError, match="expected 'bn'=4, got 3"): |
146 |
| - FuyuImagePatchInputs( |
147 |
| - flat_data=flat_data, |
148 |
| - patches_per_image=patches_per_image, |
| 144 | + input_features = torch.randn(4, 10, 160) # (b=4, fi=10, 160) |
| 145 | + input_features_mask = torch.randn(4, 8) # (b=4, fo=8) |
| 146 | + audio_embed_sizes = [8, 8, 8] # len = 3 ≠ b |
| 147 | + |
| 148 | + with pytest.raises(ValueError, match="expected 'b'=4, got 3"): |
| 149 | + GraniteSpeechAudioInputs( |
| 150 | + input_features=input_features, |
| 151 | + input_features_mask=input_features_mask, |
| 152 | + audio_embed_sizes=audio_embed_sizes, |
149 | 153 | )
|
150 | 154 |
|
151 | 155 |
|
|
0 commit comments