Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lvhan028 committed Jul 23, 2024
1 parent a52ab50 commit 260b216
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lmdeploy/serve/async_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,10 @@ async def generate(
# set random if it is not set and sequence_start is True
if gen_config.random_seed is None and sequence_start:
gen_config.random_seed = random.getrandbits(64)
if gen_config.n > 1:
logger.warning(f"n({gen_config.n}) > 1 hasn't been supported yet. "
f'Fallback to 1')
gen_config.n = 1
prompt = messages

prompt_input = await self._get_prompt_input(prompt,
Expand All @@ -576,9 +580,6 @@ async def generate(
prompt = prompt_input['prompt']
input_ids = prompt_input['input_ids']
finish_reason = None
if gen_config.n > 1:
logger.warning(f"n({gen_config.n}) > 1 hasn't been supported yet. "
f'Fallback to 1')
logger.info(f'prompt={prompt!r}, '
f'gen_config={gen_config}, '
f'prompt_token_id={input_ids}, '
Expand Down

0 comments on commit 260b216

Please sign in to comment.