Views
No views yet
config.json for detection (from llava to llava_joycaption).chat_template.json to fit the parser used by mlx_vlm.lanczos not being implemented in torch.nn.functional.interpolate).1import mlx.core as mx
2from mlx_vlm import load, generate
3from mlx_vlm.prompt_utils import apply_chat_template
4from mlx_vlm.utils import load_config
5
6# Load the model
7model_path = "n-Arno/joycaption-mlx-mxfp4"
8model, processor = load(model_path)
9config = load_config(model_path)
10
11# Prepare input
12image = ["http://images.cocodataset.org/val2017/000000039769.jpg"]
13# image = [Image.open("...")] can also be used with PIL.Image.Image objects
14prompt = "Write a long descriptive caption for this image in a formal tone."
15
16# Apply chat template
17formatted_prompt = apply_chat_template(
18 processor, config, prompt, num_images=len(image)
19)
20
21# Generate output
22output = generate(model, processor, formatted_prompt, image, verbose=False)
23print(output)requirements.txtmlx-vlm @ git+https://github.com/nArn0/mlx-vlm@main