Files
xpu-llm-ports/lfm3/tests/vl/smoke_vl.py
T
Pascal LinxweilerandClaude Opus 5.5 1834792bb8 lfm3: add INT4, FP8 per-channel and VL notes, tests, eval and results
Sync the repo with the working directory: full NOTES.md (rounds 4-5, LFM3-VL),
VL tests and test images, quality eval, AutoRound W4A16 quantization scripts
and calibration recipe, the variant.sh MODEL/DOCKER_ENV options, and the
remaining benchmark results. Large regenerable artifacts (INT4 checkpoint,
ref_vl.pt, raw logprob dumps) stay out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 13:59:43 +01:00

17 lines
725 B
Python

import sys
from PIL import Image
from vllm import LLM, SamplingParams
def main():
llm = LLM(model="/vl", dtype="bfloat16", max_model_len=8192, gpu_memory_utilization=0.4,
limit_mm_per_prompt={"image": 4}, enforce_eager=True)
msgs = [{"role": "user", "content": [{"type": "image_pil", "image_pil": Image.open("/tests/vl/images/photo.jpeg").convert("RGB")},
{"type": "text", "text": "What newspaper is this?"}]}]
o = llm.chat(msgs, SamplingParams(max_tokens=80, temperature=0.0))[0]
print("PROMPT_LEN", len(o.prompt_token_ids), "IMG_TOK", o.prompt_token_ids.count(125030))
print("OUT", repr(o.outputs[0].text))
if __name__ == "__main__":
main()