Skip to content

Commit

Permalink
fix: avoid generating empty content for Stability (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik authored Jan 12, 2024
1 parent 9f42f1e commit eeff435
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aidial_adapter_bedrock/llm/model/stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class StabilityResponse(BaseModel):

def content(self) -> str:
self._throw_if_error()
return ""
# NOTE: text-to-text models aren't expected to generate empty strings.
# So since we represent text-to-image model (Stability) as
# a text-to-text model (via chat completion interface),
# we need to return something.
return " "

def attachments(self) -> list[Attachment]:
self._throw_if_error()
Expand Down

0 comments on commit eeff435

Please sign in to comment.