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>
17 lines
725 B
Python
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()
|