From e168a9bf69e9109b0f4b7cb5c253125db5a6a115 Mon Sep 17 00:00:00 2001 From: annaiyan Date: Sun, 8 Feb 2026 04:18:46 +0100 Subject: [PATCH] Fix CLI generation to honor temperature and max token args --- llava/serve/cli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/llava/serve/cli.py b/llava/serve/cli.py index 88fbfe85d..ae4c92e2f 100755 --- a/llava/serve/cli.py +++ b/llava/serve/cli.py @@ -86,7 +86,16 @@ def main(args): streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True) with torch.inference_mode(): - output_ids = model.generate(input_ids, images=image_tensor, do_sample=True, temperature=0.2, max_new_tokens=1024, streamer=streamer, use_cache=True, stopping_criteria=[stopping_criteria]) + output_ids = model.generate( + input_ids, + images=image_tensor, + do_sample=args.temperature > 0, + temperature=args.temperature, + max_new_tokens=args.max_new_tokens, + streamer=streamer, + use_cache=True, + stopping_criteria=[stopping_criteria], + ) outputs = tokenizer.decode(output_ids[0, input_ids.shape[1] :]).strip() conv.messages[-1][-1] = outputs