Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
54cc46f3
Unverified
Commit
54cc46f3
authored
Mar 14, 2025
by
WeiCheng
Committed by
GitHub
Mar 14, 2025
Browse files
[Bugfix] Fix small typo in the example of Streaming delimiter (#14793)
parent
601bd326
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
examples/online_serving/api_client.py
examples/online_serving/api_client.py
+1
-1
examples/online_serving/gradio_webserver.py
examples/online_serving/gradio_webserver.py
+1
-1
No files found.
examples/online_serving/api_client.py
View file @
54cc46f3
...
@@ -42,7 +42,7 @@ def post_http_request(prompt: str,
...
@@ -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"
]
...
...
examples/online_serving/gradio_webserver.py
View file @
54cc46f3
...
@@ -21,7 +21,7 @@ def http_bot(prompt):
...
@@ -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
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment