Skip to content

Commit 54cc46f

Browse files
authored
[Bugfix] Fix small typo in the example of Streaming delimiter (#14793)
1 parent 601bd32 commit 54cc46f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/online_serving/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def post_http_request(prompt: str,
4242
def get_streaming_response(response: requests.Response) -> Iterable[list[str]]:
4343
for chunk in response.iter_lines(chunk_size=8192,
4444
decode_unicode=False,
45-
delimiter=b"\0"):
45+
delimiter=b"\n"):
4646
if chunk:
4747
data = json.loads(chunk.decode("utf-8"))
4848
output = data["text"]

examples/online_serving/gradio_webserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def http_bot(prompt):
2121

2222
for chunk in response.iter_lines(chunk_size=8192,
2323
decode_unicode=False,
24-
delimiter=b"\0"):
24+
delimiter=b"\n"):
2525
if chunk:
2626
data = json.loads(chunk.decode("utf-8"))
2727
output = data["text"][0]

0 commit comments

Comments
 (0)