Views
No views yet
mlx_vlm.convert --hf-path janhq/Jan-v2-VL-med --quantize --q-bits 8 --mlx-path Jan-v2-VL-med-8bit-mlxpip install mlx-vlm1from mlx_vlm import load, generate
2from mlx_vlm.prompt_utils import apply_chat_template
3from mlx_vlm.utils import load_config
4
5# Load the model
6model_path = "mlx-community/Jan-v2-VL-med-8bit-mlx"
7model, processor = load(model_path)
8config = load_config(model_path)
9
10# Prepare input
11image = ["path/to/image.jpg"]
12prompt = "Describe this image."
13
14# Apply chat template
15formatted_prompt = apply_chat_template(
16 processor, config, prompt, num_images=len(image)
17)
18
19# Generate output
20output = generate(model, processor, formatted_prompt, image, verbose=False)
21print(output)mlx_vlm.generate --model mlx-community/Jan-v2-VL-med-8bit-mlx --max-tokens 100 --prompt "Describe this image" --image path/to/image.jpg