prithivMLmods commited on
Commit
daee27d
·
verified ·
1 Parent(s): 20d2ee4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +135 -0
README.md CHANGED
@@ -5,3 +5,138 @@ pipeline_tag: image-text-to-text
5
  tags:
6
  - mlx
7
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  tags:
6
  - mlx
7
  ---
8
+
9
+
10
+
11
+ ## Use with mlx
12
+
13
+ Install the required library:
14
+
15
+ ```bash
16
+ pip install -U mlx-vlm
17
+ ```
18
+
19
+ > **Model Note:** `Zenith-9B-CodeCore-Merge` is a 9-billion parameter multimodal coding model designed for code generation, visual debugging, repository reasoning, and architecture diagram analysis. It supports both text and image/screenshot inputs.
20
+
21
+ ### BF16 Variant (Base Weights)
22
+
23
+ The full-precision BF16 files reside directly in the root of the repository:
24
+
25
+ #### CLI (Terminal)
26
+
27
+ ```bash
28
+ python -m mlx_vlm generate \
29
+ --model prithivMLmods/Zenith-9B-CodeCore-Merge-MLX \
30
+ --max-tokens 512 \
31
+ --temperature 0.0 \
32
+ --prompt "Analyze this code screenshot, explain what it does, and fix any potential bugs or edge cases." \
33
+ --image <path_to_image>
34
+ ```
35
+
36
+ #### Python API
37
+
38
+ ```python
39
+ from mlx_vlm import load, generate
40
+ from mlx_vlm.prompt_utils import apply_chat_template
41
+ from mlx_vlm.utils import load_config
42
+
43
+ model_path = "prithivMLmods/Zenith-9B-CodeCore-Merge-MLX"
44
+ model, processor = load(model_path)
45
+ config = load_config(model_path)
46
+
47
+ image = ["<path_to_image>"]
48
+ prompt = "Analyze this code screenshot, explain what it does, and fix any potential bugs or edge cases."
49
+ formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
50
+
51
+ output = generate(
52
+ model,
53
+ processor,
54
+ formatted_prompt,
55
+ image=image,
56
+ max_tokens=512,
57
+ temperature=0.0
58
+ )
59
+ print(output.text)
60
+ ```
61
+
62
+ ### 8-bit Variant
63
+
64
+ Target the `8bit` subfolder:
65
+
66
+ #### CLI (Terminal)
67
+
68
+ ```bash
69
+ python -m mlx_vlm generate \
70
+ --model prithivMLmods/Zenith-9B-CodeCore-Merge-MLX/8bit \
71
+ --max-tokens 512 \
72
+ --temperature 0.0 \
73
+ --prompt "Analyze this code screenshot, explain what it does, and fix any potential bugs or edge cases." \
74
+ --image <path_to_image>
75
+ ```
76
+
77
+ #### Python API
78
+
79
+ ```python
80
+ from mlx_vlm import load, generate
81
+ from mlx_vlm.prompt_utils import apply_chat_template
82
+ from mlx_vlm.utils import load_config
83
+
84
+ model_path = "prithivMLmods/Zenith-9B-CodeCore-Merge-MLX"
85
+ model, processor = load(model_path, subfolder="8bit")
86
+ config = load_config(model_path, subfolder="8bit")
87
+
88
+ image = ["<path_to_image>"]
89
+ prompt = "Analyze this code screenshot, explain what it does, and fix any potential bugs or edge cases."
90
+ formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
91
+
92
+ output = generate(
93
+ model,
94
+ processor,
95
+ formatted_prompt,
96
+ image=image,
97
+ max_tokens=512,
98
+ temperature=0.0
99
+ )
100
+ print(output.text)
101
+ ```
102
+
103
+ ### 4-bit Variant
104
+
105
+ Target the `4bit` subfolder:
106
+
107
+ #### CLI (Terminal)
108
+
109
+ ```bash
110
+ python -m mlx_vlm generate \
111
+ --model prithivMLmods/Zenith-9B-CodeCore-Merge-MLX/4bit \
112
+ --max-tokens 512 \
113
+ --temperature 0.0 \
114
+ --prompt "Analyze this code screenshot, explain what it does, and fix any potential bugs or edge cases." \
115
+ --image <path_to_image>
116
+ ```
117
+
118
+ #### Python API
119
+
120
+ ```python
121
+ from mlx_vlm import load, generate
122
+ from mlx_vlm.prompt_utils import apply_chat_template
123
+ from mlx_vlm.utils import load_config
124
+
125
+ model_path = "prithivMLmods/Zenith-9B-CodeCore-Merge-MLX"
126
+ model, processor = load(model_path, subfolder="4bit")
127
+ config = load_config(model_path, subfolder="4bit")
128
+
129
+ image = ["<path_to_image>"]
130
+ prompt = "Analyze this code screenshot, explain what it does, and fix any potential bugs or edge cases."
131
+ formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
132
+
133
+ output = generate(
134
+ model,
135
+ processor,
136
+ formatted_prompt,
137
+ image=image,
138
+ max_tokens=512,
139
+ temperature=0.0
140
+ )
141
+ print(output.text)
142
+ ```