Skip to content

Commit 019f76f

Browse files
authored
Fix how stream flag is read from request (#1441)
1 parent 68b8087 commit 019f76f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

torchchat/usages/openai_api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ class CompletionRequest:
180180
user: Optional[str] = None # unimplemented
181181

182182
def __post_init__(self):
183-
self.stream = bool(self.stream)
183+
if isinstance(self.stream, str):
184+
self.stream = self.stream.lower() != "false"
185+
else:
186+
self.stream = bool(self.stream)
184187

185188

186189
@dataclass

0 commit comments

Comments
 (0)