Views
No views yet
pip 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 = "aimeri/spoomplesmaxx-flash-35B-A3-mlx-vlm-3Bit"
7model, processor = load(model_path)
8config = load_config(model_path)
9
10# Prepare input
11image = ["http://images.cocodataset.org/val2017/000000039769.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)