Skip to content

Commit 6106a71

Browse files
committed
Fix serialization
1 parent ffcb28d commit 6106a71

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/guidellm/core/request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import uuid
2-
from typing import Any, Dict, List, Optional
2+
from typing import Any, Dict, List, Optional, Tuple
33

44
from pydantic import Field
55

@@ -42,7 +42,7 @@ def number_images(self) -> int:
4242
return len(self.images)
4343

4444
@property
45-
def image_resolution(self) -> List[int]:
45+
def image_resolution(self) -> List[Tuple[int]]:
4646
if self.images is None:
4747
return None
4848
else:

src/guidellm/utils/images.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from io import BytesIO
2-
from typing import List, Optional
2+
from typing import List, Optional, Tuple
33
from urllib.parse import urljoin
44

55
import requests
@@ -28,11 +28,11 @@ class ImageDescriptor(Serializable):
2828

2929
@computed_field # type: ignore[misc]
3030
@property
31-
def image_resolution(self) -> List[int]:
32-
if self.images is None:
31+
def image_resolution(self) -> Tuple[int]:
32+
if self.image is None:
3333
return None
3434
else:
35-
return [im.size for im in self.images]
35+
return self.image.size
3636

3737

3838
def load_images(data: str, image_resolution: Optional[List[int]]) -> List[ImageDescriptor]:

0 commit comments

Comments
 (0)