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
8153168c
Unverified
Commit
8153168c
authored
Aug 28, 2024
by
Zhiqiang Xie
Committed by
GitHub
Aug 28, 2024
Browse files
fix data racing due to mutable reference using deepcopy (#1255)
parent
6c34d633
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
python/sglang/srt/managers/io_struct.py
python/sglang/srt/managers/io_struct.py
+6
-1
No files found.
python/sglang/srt/managers/io_struct.py
View file @
8153168c
...
...
@@ -18,8 +18,9 @@ The definition of objects transfered between different
processes (TokenizerManager, DetokenizerManager, Controller).
"""
import
copy
import
uuid
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
,
field
from
typing
import
Dict
,
List
,
Optional
,
Union
from
sglang.srt.managers.schedule_batch
import
BaseFinishReason
...
...
@@ -249,6 +250,10 @@ class BatchTokenIDOut:
meta_info
:
List
[
Dict
]
finished_reason
:
List
[
BaseFinishReason
]
def
__post_init__
(
self
):
# deepcopy meta_info to avoid modification in place
self
.
meta_info
=
copy
.
deepcopy
(
self
.
meta_info
)
@
dataclass
class
BatchStrOut
:
...
...
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