File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ def add_parser_api_server():
123123 type = str ,
124124 default = '' ,
125125 help = 'Qos policy config path' )
126+ parser .add_argument ('--log-stats' ,
127+ type = bool ,
128+ default = False ,
129+ help = 'Whether log stats to prometheus' )
126130 # common args
127131 ArgumentHelper .backend (parser )
128132 ArgumentHelper .log_level (parser )
@@ -294,7 +298,8 @@ def api_server(args):
294298 log_level = args .log_level .upper (),
295299 api_keys = args .api_keys ,
296300 ssl = args .ssl ,
297- qos_config_path = args .qos_config_path )
301+ qos_config_path = args .qos_config_path ,
302+ log_stats = args .log_stats )
298303
299304 @staticmethod
300305 def api_client (args ):
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ def __init__(self,
174174 PytorchEngineConfig ]] = None ,
175175 chat_template_config : Optional [ChatTemplateConfig ] = None ,
176176 tp : int = 1 ,
177- log_stats : bool = True ,
177+ log_stats : bool = False ,
178178 ** kwargs ) -> None :
179179 logger .info (
180180 f'input backend={ backend } , backend_config={ backend_config } ' )
Original file line number Diff line number Diff line change @@ -993,6 +993,7 @@ def serve(model_path: str,
993993 api_keys : Optional [Union [List [str ], str ]] = None ,
994994 ssl : bool = False ,
995995 qos_config_path : str = '' ,
996+ log_stats : bool = False ,
996997 ** kwargs ):
997998 """An example to perform model inference through the command line
998999 interface.
@@ -1031,6 +1032,7 @@ def serve(model_path: str,
10311032 a single api_key. Default to None, which means no api key applied.
10321033 ssl (bool): Enable SSL. Requires OS Environment variables 'SSL_KEYFILE' and 'SSL_CERTFILE'.
10331034 qos_config_path (str): qos policy config path
1035+ log_stats (bool): Whether log stats to prometheus.
10341036 """ # noqa E501
10351037 if os .getenv ('TM_LOG_LEVEL' ) is None :
10361038 os .environ ['TM_LOG_LEVEL' ] = log_level
@@ -1064,6 +1066,7 @@ def serve(model_path: str,
10641066 backend_config = backend_config ,
10651067 chat_template_config = chat_template_config ,
10661068 tp = tp ,
1069+ log_stats = log_stats ,
10671070 ** kwargs )
10681071
10691072 if qos_config_path :
You can’t perform that action at this time.
0 commit comments