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
c614dbdf
Unverified
Commit
c614dbdf
authored
Mar 17, 2025
by
Yinghai Lu
Committed by
GitHub
Mar 17, 2025
Browse files
Nicer standalone engine inferface (#4480)
parent
927ca935
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
python/sglang/srt/entrypoints/engine.py
python/sglang/srt/entrypoints/engine.py
+7
-0
No files found.
python/sglang/srt/entrypoints/engine.py
View file @
c614dbdf
...
...
@@ -249,6 +249,13 @@ class Engine:
"""Shutdown the engine"""
kill_process_tree
(
os
.
getpid
(),
include_parent
=
False
)
def
__enter__
(
self
):
return
self
def
__exit__
(
self
,
exc_type
,
exc_value
,
traceback
):
self
.
shutdown
()
return
False
def
start_profile
(
self
):
loop
=
asyncio
.
get_event_loop
()
loop
.
run_until_complete
(
self
.
tokenizer_manager
.
start_profile
())
...
...
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