Skip to content

Commit 1aa8258

Browse files
huangtingwei9988CatherineSue
authored andcommitted
bugfix: Prevent global mutation of conv.stop_str across requests (sgl-project#7347)
Co-authored-by: Chang Su <chang.s.su@oracle.com>
1 parent 9041fa3 commit 1aa8258

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

python/sglang/srt/entrypoints/openai/serving_chat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import copy
12
import json
23
import logging
34
import time
@@ -292,7 +293,7 @@ def _apply_conversation_template(
292293
image_data = conv.image_data if conv.image_data else None
293294
audio_data = conv.audio_data if conv.audio_data else None
294295
modalities = conv.modalities if conv.modalities else []
295-
stop = conv.stop_str or [] if not request.ignore_eos else []
296+
stop = copy.copy(conv.stop_str or [] if not request.ignore_eos else [])
296297

297298
if request.stop:
298299
if isinstance(request.stop, str):

0 commit comments

Comments
 (0)