8000 Add warning message about `do_sample` to alert BC (#2654) · InferenceNexus/lmdeploy@c25520a · GitHub
[go: up one dir, main page]

Skip to content

Commit c25520a

Browse files
authored
Add warning message about do_sample to alert BC (InternLM#2654)
* add warning message for do_sample * update * update
1 parent fafd666 commit c25520a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lmdeploy/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def pipeline(model_path: str,
1111
backend_config: Optional[Union[TurbomindEngineConfig,
1212
PytorchEngineConfig]] = None,
1313
chat_template_config: Optional[ChatTemplateConfig] = None,
14-
log_level: str = 'ERROR',
14+
log_level: str = 'WARNING',
1515
max_log_len: int = None,
1616
**kwargs):
1717
"""

lmdeploy/serve/async_engine.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,12 @@ async def generate(
501501
if gen_config.stop_token_ids is None:
502502
gen_config.stop_token_ids = self.stop_words
503503
if not gen_config.do_sample:
504+
logger.warn(f'GenerationConfig: {gen_config}')
505+
logger.warn(
506+
'Since v0.6.0, lmdeploy add `do_sample` in '
507+
'GenerationConfig. It defaults to False, meaning greedy '
508+
'decoding. Please set `do_sample=True` if sampling '
509+
' decoding is needed')
504510
# greedy decode
505511
gen_config.top_k = 1
506512
# avoid unnecessary process

0 commit comments

Comments
 (0)
0