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
4a9f8ea4
Unverified
Commit
4a9f8ea4
authored
Sep 01, 2024
by
Byron Hsu
Committed by
GitHub
Sep 01, 2024
Browse files
[doc] Fix more broken links (#1294)
parent
58fa6076
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
README.md
README.md
+3
-3
No files found.
README.md
View file @
4a9f8ea4
...
@@ -393,7 +393,7 @@ You can implement your prompt flow in a function decorated by `sgl.function`.
...
@@ -393,7 +393,7 @@ You can implement your prompt flow in a function decorated by `sgl.function`.
You can then invoke the function with
`run`
or
`run_batch`
.
You can then invoke the function with
`run`
or
`run_batch`
.
The system will manage the state, chat template, parallelism and batching for you.
The system will manage the state, chat template, parallelism and batching for you.
The complete code for the examples below can be found at
[
readme_examples.py
](
examples/usage/readme_examples.py
)
The complete code for the examples below can be found at
[
readme_examples.py
](
examples/
frontend_language/
usage/readme_examples.py
)
#### Control Flow
#### Control Flow
You can use any Python code within the function body, including control flow, nested function calls, and external libraries.
You can use any Python code within the function body, including control flow, nested function calls, and external libraries.
...
@@ -442,7 +442,7 @@ def image_qa(s, image_file, question):
...
@@ -442,7 +442,7 @@ def image_qa(s, image_file, question):
s
+=
sgl
.
assistant
(
sgl
.
gen
(
"answer"
,
max_tokens
=
256
)
s
+=
sgl
.
assistant
(
sgl
.
gen
(
"answer"
,
max_tokens
=
256
)
```
```
See also
[
srt_example_llava.py
](
examples/quick_start/
srt
_example_llava.py
)
.
See also
[
srt_example_llava.py
](
examples/
frontend_language/
quick_start/
local
_example_llava
_next
.py
)
.
#### Constrained Decoding
#### Constrained Decoding
Use
`regex`
to specify a regular expression as a decoding constraint.
Use
`regex`
to specify a regular expression as a decoding constraint.
...
@@ -486,7 +486,7 @@ def character_gen(s, name):
...
@@ -486,7 +486,7 @@ def character_gen(s, name):
s
+=
sgl
.
gen
(
"json_output"
,
max_tokens
=
256
,
regex
=
character_regex
)
s
+=
sgl
.
gen
(
"json_output"
,
max_tokens
=
256
,
regex
=
character_regex
)
```
```
See also
[
json_decode.py
](
examples/usage/json_decode.py
)
for an additional example of specifying formats with Pydantic models.
See also
[
json_decode.py
](
examples/
frontend_language/
usage/json_decode.py
)
for an additional example of specifying formats with Pydantic models.
#### Batching
#### Batching
Use
`run_batch`
to run a batch of requests with continuous batching.
Use
`run_batch`
to run a batch of requests with continuous batching.
...
...
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