[Minor] more code cleanup (#4077)

This commit is contained in:
Lianmin Zheng
2025-03-04 21:23:47 -08:00
committed by GitHub
parent 4725e3f652
commit e074d84e5b
15 changed files with 123 additions and 31 deletions

View File

@@ -212,6 +212,7 @@ class DetokenizerManager:
rids=recv_obj.rids,
finished_reasons=recv_obj.finished_reasons,
output_strs=output_strs,
output_ids=None,
prompt_tokens=recv_obj.prompt_tokens,
completion_tokens=recv_obj.completion_tokens,
cached_tokens=recv_obj.cached_tokens,

View File

@@ -414,6 +414,12 @@ class BatchTokenIDOut:
class BatchMultimodalDecodeReq:
# The request id
rids: List[str]
finished_reasons: List[BaseFinishReason]
# Token counts
prompt_tokens: List[int]
completion_tokens: List[int]
cached_tokens: List[int]
@dataclass
@@ -424,6 +430,8 @@ class BatchStrOut:
finished_reasons: List[dict]
# The output decoded strings
output_strs: List[str]
# The token ids
output_ids: Optional[List[int]]
# Token counts
prompt_tokens: List[int]
@@ -453,6 +461,15 @@ class BatchStrOut:
class BatchMultimodalOut:
# The request id
rids: List[str]
# The finish reason
finished_reasons: List[dict]
# The outputs
outputs: List[List[Dict]]
# Token counts
prompt_tokens: List[int]
completion_tokens: List[int]
cached_tokens: List[int]
@dataclass

View File

@@ -1141,7 +1141,7 @@ async def print_exception_wrapper(func):
class SignalHandler:
def __init__(self, tokenizer_manager):
def __init__(self, tokenizer_manager: TokenizerManager):
self.tokenizer_manager = tokenizer_manager
def signal_handler(self, signum=None, frame=None):