File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
lightllm/server/detokenization Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -105,15 +105,16 @@ def gen_token_out(self):
105105 exist_need_detoken = False
106106 exist_decode = False
107107 for decode_req in self .req_id_to_out .values ():
108+ # 已经满足停止字符串停止条件,则不再处理后续生成 token
109+ if decode_req .req .stop_str_matched :
110+ continue
111+
108112 if decode_req .need_detoken () and not decode_req .out_queue_is_full ():
109113 new_token_id , src_index = decode_req .get_next_token_id_and_index ()
110114 decode_req .output_ids .append (new_token_id )
111115 special = new_token_id in self .all_special_ids
112116 count_output_tokens = len (decode_req .output_ids )
113117
114- if decode_req .req .stop_str_matched :
115- continue
116-
117118 exist_decode = True
118119 new_text = decode_token (
119120 self .tokenizer ,
You can’t perform that action at this time.
0 commit comments