mypy compliant
This commit is contained in:
@@ -52,7 +52,7 @@ class ModelOutputs(BaseModel):
|
||||
def from_random(cls) -> ModelOutputs:
|
||||
"""Instantiate with random numbers."""
|
||||
kwargs = {
|
||||
field: field_info.annotation.from_random()
|
||||
field: field_info.annotation.from_random() # type: ignore
|
||||
for field, field_info
|
||||
in cls.model_fields.items()
|
||||
}
|
||||
@@ -124,7 +124,7 @@ class VisualCommunication(BaseModel):
|
||||
return VisualCommunication(name=name, image=image)
|
||||
|
||||
@field_serializer("image")
|
||||
def serialize_image(image: Image.Image) -> bytes:
|
||||
def serialize_image(image: Image.Image) -> bytes: # type: ignore
|
||||
buffer = BytesIO()
|
||||
image.save(buffer, format="JPEG")
|
||||
return buffer.getvalue()
|
||||
|
||||
Reference in New Issue
Block a user