[Minor] Improve logging and rename the health check endpoint name (#1180)
This commit is contained in:
@@ -21,7 +21,6 @@ Each data parallel worker can manage multiple tensor parallel workers.
|
||||
import dataclasses
|
||||
import logging
|
||||
import multiprocessing
|
||||
import os
|
||||
from enum import Enum, auto
|
||||
|
||||
import numpy as np
|
||||
|
||||
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
|
||||
import logging
|
||||
import multiprocessing
|
||||
import os
|
||||
from typing import List
|
||||
|
||||
import zmq
|
||||
|
||||
@@ -39,6 +39,8 @@ asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
|
||||
|
||||
@dataclasses.dataclass
|
||||
class DecodeStatus:
|
||||
"""Store the status of incremental decoding."""
|
||||
|
||||
vid: int
|
||||
decoded_text: str
|
||||
decode_ids: List[int]
|
||||
@@ -47,6 +49,8 @@ class DecodeStatus:
|
||||
|
||||
|
||||
class DetokenizerManager:
|
||||
"""DetokenizerManager is a process that detokenizes the token ids."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
server_args: ServerArgs,
|
||||
|
||||
@@ -62,12 +62,16 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
@dataclasses.dataclass
|
||||
class ReqState:
|
||||
"""Store the state a request."""
|
||||
|
||||
out_list: List
|
||||
finished: bool
|
||||
event: asyncio.Event
|
||||
|
||||
|
||||
class TokenizerManager:
|
||||
"""TokenizerManager is a process that tokenizes the text."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
server_args: ServerArgs,
|
||||
@@ -481,11 +485,7 @@ class TokenizerManager:
|
||||
|
||||
# Log requests
|
||||
if self.server_args.log_requests and state.finished:
|
||||
if obj.text is None:
|
||||
in_obj = {"input_ids": obj.input_ids}
|
||||
else:
|
||||
in_obj = {"text": obj.text}
|
||||
logger.info(f"in={in_obj}, out={out}")
|
||||
logger.info(f"in={obj}, out={out}")
|
||||
|
||||
state.out_list = []
|
||||
if state.finished:
|
||||
|
||||
Reference in New Issue
Block a user