Spaces:
Running
on
Zero
Running
on
Zero
Removed sampling
#1
by
Devio
- opened
app.py
CHANGED
@@ -140,7 +140,7 @@ def internvl_inference(image_path: str | None, text_input: str | None = None):
|
|
140 |
return "Please upload an image first."
|
141 |
pixel_values = load_image(image_path, max_num=12).to(torch.bfloat16).cuda()
|
142 |
prompt = f"<image>\n{text_input}" if text_input else "<image>\n"
|
143 |
-
gen_cfg = dict(max_new_tokens=1024, do_sample=
|
144 |
return model.chat(tokenizer, pixel_values, prompt, gen_cfg)
|
145 |
|
146 |
|
|
|
140 |
return "Please upload an image first."
|
141 |
pixel_values = load_image(image_path, max_num=12).to(torch.bfloat16).cuda()
|
142 |
prompt = f"<image>\n{text_input}" if text_input else "<image>\n"
|
143 |
+
gen_cfg = dict(max_new_tokens=1024, do_sample=False)
|
144 |
return model.chat(tokenizer, pixel_values, prompt, gen_cfg)
|
145 |
|
146 |
|