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
5f283991
Unverified
Commit
5f283991
authored
Jun 12, 2024
by
Fabian Preiß
Committed by
GitHub
Jun 11, 2024
Browse files
[Minor] Correct Optional type hints in api (#526)
parent
b6667a53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
python/sglang/api.py
python/sglang/api.py
+3
-3
No files found.
python/sglang/api.py
View file @
5f283991
...
@@ -43,14 +43,14 @@ def set_default_backend(backend: BaseBackend):
...
@@ -43,14 +43,14 @@ def set_default_backend(backend: BaseBackend):
global_config
.
default_backend
=
backend
global_config
.
default_backend
=
backend
def
flush_cache
(
backend
:
BaseBackend
=
None
):
def
flush_cache
(
backend
:
Optional
[
BaseBackend
]
=
None
):
backend
=
backend
or
global_config
.
default_backend
backend
=
backend
or
global_config
.
default_backend
if
backend
is
None
:
if
backend
is
None
:
return
False
return
False
return
backend
.
flush_cache
()
return
backend
.
flush_cache
()
def
get_server_args
(
backend
:
BaseBackend
=
None
):
def
get_server_args
(
backend
:
Optional
[
BaseBackend
]
=
None
):
backend
=
backend
or
global_config
.
default_backend
backend
=
backend
or
global_config
.
default_backend
if
backend
is
None
:
if
backend
is
None
:
return
None
return
None
...
@@ -158,7 +158,7 @@ def video(path: str, num_frames: int):
...
@@ -158,7 +158,7 @@ def video(path: str, num_frames: int):
def
select
(
def
select
(
name
:
Optional
[
str
]
=
None
,
name
:
Optional
[
str
]
=
None
,
choices
:
List
[
str
]
=
None
,
choices
:
Optional
[
List
[
str
]
]
=
None
,
temperature
:
float
=
0.0
,
temperature
:
float
=
0.0
,
):
):
assert
choices
is
not
None
assert
choices
is
not
None
...
...
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