[bug] fixed batch api for DeepSeek V3/R1 (#3754)
This commit is contained in:
@@ -162,6 +162,7 @@ class DetokenizerManager:
|
|||||||
|
|
||||||
# Incremental decoding
|
# Incremental decoding
|
||||||
output_strs = []
|
output_strs = []
|
||||||
|
finished_reqs = []
|
||||||
for i in range(bs):
|
for i in range(bs):
|
||||||
try:
|
try:
|
||||||
s = self.decode_status[recv_obj.rids[i]]
|
s = self.decode_status[recv_obj.rids[i]]
|
||||||
@@ -184,6 +185,8 @@ class DetokenizerManager:
|
|||||||
new_text = ""
|
new_text = ""
|
||||||
else:
|
else:
|
||||||
new_text = find_printable_text(new_text)
|
new_text = find_printable_text(new_text)
|
||||||
|
else:
|
||||||
|
finished_reqs.append(recv_obj.rids[i])
|
||||||
|
|
||||||
output_strs.append(
|
output_strs.append(
|
||||||
self.trim_matched_stop(
|
self.trim_matched_stop(
|
||||||
@@ -214,6 +217,10 @@ class DetokenizerManager:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# remove decodestatus for completed requests
|
||||||
|
for rid in finished_reqs:
|
||||||
|
self.decode_status.pop(rid)
|
||||||
|
|
||||||
|
|
||||||
class LimitedCapacityDict(OrderedDict):
|
class LimitedCapacityDict(OrderedDict):
|
||||||
def __init__(self, capacity: int, *args, **kwargs):
|
def __init__(self, capacity: int, *args, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user