Skip to content

Commit

Permalink
Fix how stream flag is read from request (#1441)
Browse files Browse the repository at this point in the history
  • Loading branch information
mreso authored Dec 25, 2024
1 parent 68b8087 commit 019f76f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion torchchat/usages/openai_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ class CompletionRequest:
user: Optional[str] = None # unimplemented

def __post_init__(self):
self.stream = bool(self.stream)
if isinstance(self.stream, str):
self.stream = self.stream.lower() != "false"
else:
self.stream = bool(self.stream)


@dataclass
Expand Down

0 comments on commit 019f76f

Please sign in to comment.