Changesets · Branches · Tags · Compare
| Changeset | e7062e989c61a2789147a74664e4bef4940e4bc19ae8c9d44c649a14dfb2dd3a |
|---|---|
| Author | mark <51519902+mark-lord@users.noreply.github.com> · 2024-10-12 15:35 +01:00 |
| Committer | GitHub <noreply@github.com> · 2024-10-12 16:35 +02:00 |
| Parents | 298bbfc46d57 |
1 file changed
modified README.md +4 −0
| @@ -47,10 +47,12 @@ | ||
| 47 | 47 | import mlx.core as mx |
| 48 | 48 | from mlx_vlm import load, generate |
| 49 | 49 | from mlx_vlm.prompt_utils import apply_chat_template |
| 50 | +from mlx_vlm.utils import load_config | |
| 50 | 51 | |
| 51 | 52 | # Load the model |
| 52 | 53 | model_path = "mlx-community/Qwen2-VL-2B-Instruct-4bit" |
| 53 | 54 | model, processor = load(model_path) |
| 55 | +config = load_config(model_path) | |
| 54 | 56 | |
| 55 | 57 | # Prepare input |
| 56 | 58 | image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] |
| @@ -87,9 +89,11 @@ | ||
| 87 | 89 | ```python |
| 88 | 90 | from mlx_vlm import load, generate |
| 89 | 91 | from mlx_vlm.prompt_utils import apply_chat_template |
| 92 | +from mlx_vlm.utils import load_config | |
| 90 | 93 | |
| 91 | 94 | model_path = "mlx-community/Qwen2-VL-2B-Instruct-4bit" |
| 92 | 95 | model, processor = load(model_path) |
| 96 | +config = load_config(model_path) | |
| 93 | 97 | |
| 94 | 98 | images = ["path/to/image1.jpg", "path/to/image2.jpg"] |
| 95 | 99 | prompt = "Compare these two images." |