Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
876db8dc
Unverified
Commit
876db8dc
authored
Jan 31, 2024
by
Lianmin Zheng
Committed by
GitHub
Jan 31, 2024
Browse files
Update sampling_params.md
parent
ad82bac6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
docs/sampling_params.md
docs/sampling_params.md
+6
-3
No files found.
docs/sampling_params.md
View file @
876db8dc
...
@@ -84,9 +84,12 @@ response = requests.post(
...
@@ -84,9 +84,12 @@ response = requests.post(
)
)
prev
=
0
prev
=
0
for
chunk
in
response
.
iter_lines
(
decode_unicode
=
False
,
delimiter
=
b
"
\0
"
):
for
chunk
in
response
.
iter_lines
(
decode_unicode
=
False
):
if
chunk
:
chunk
=
chunk
.
decode
(
"utf-8"
)
data
=
json
.
loads
(
chunk
.
decode
())
if
chunk
and
chunk
.
startswith
(
"data:"
):
if
chunk
==
"data: [DONE]"
:
break
data
=
json
.
loads
(
chunk
[
5
:].
strip
(
"
\n
"
))
output
=
data
[
"text"
].
strip
()
output
=
data
[
"text"
].
strip
()
print
(
output
[
prev
:],
end
=
""
,
flush
=
True
)
print
(
output
[
prev
:],
end
=
""
,
flush
=
True
)
prev
=
len
(
output
)
prev
=
len
(
output
)
...
...
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