mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 18:15:27 +08:00
[Bugfix] Fix small typo in the example of Streaming delimiter (#14793)
This commit is contained in:
parent
601bd3268e
commit
54cc46f3eb
@ -42,7 +42,7 @@ def post_http_request(prompt: str,
|
|||||||
def get_streaming_response(response: requests.Response) -> Iterable[list[str]]:
|
def get_streaming_response(response: requests.Response) -> Iterable[list[str]]:
|
||||||
for chunk in response.iter_lines(chunk_size=8192,
|
for chunk in response.iter_lines(chunk_size=8192,
|
||||||
decode_unicode=False,
|
decode_unicode=False,
|
||||||
delimiter=b"\0"):
|
delimiter=b"\n"):
|
||||||
if chunk:
|
if chunk:
|
||||||
data = json.loads(chunk.decode("utf-8"))
|
data = json.loads(chunk.decode("utf-8"))
|
||||||
output = data["text"]
|
output = data["text"]
|
||||||
|
|||||||
@ -21,7 +21,7 @@ def http_bot(prompt):
|
|||||||
|
|
||||||
for chunk in response.iter_lines(chunk_size=8192,
|
for chunk in response.iter_lines(chunk_size=8192,
|
||||||
decode_unicode=False,
|
decode_unicode=False,
|
||||||
delimiter=b"\0"):
|
delimiter=b"\n"):
|
||||||
if chunk:
|
if chunk:
|
||||||
data = json.loads(chunk.decode("utf-8"))
|
data = json.loads(chunk.decode("utf-8"))
|
||||||
output = data["text"][0]
|
output = data["text"][0]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user