nexaai 1.0.16rc13__cp310-cp310-macosx_13_0_x86_64.whl → 1.0.17rc1__cp310-cp310-macosx_13_0_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nexaai might be problematic. Click here for more details.
- nexaai/_stub.cpython-310-darwin.so +0 -0
- nexaai/_version.py +1 -1
- nexaai/binds/libnexa_bridge.dylib +0 -0
- nexaai/mlx_backend/vlm/interface.py +33 -2
- {nexaai-1.0.16rc13.dist-info → nexaai-1.0.17rc1.dist-info}/METADATA +1 -1
- {nexaai-1.0.16rc13.dist-info → nexaai-1.0.17rc1.dist-info}/RECORD +8 -8
- {nexaai-1.0.16rc13.dist-info → nexaai-1.0.17rc1.dist-info}/WHEEL +0 -0
- {nexaai-1.0.16rc13.dist-info → nexaai-1.0.17rc1.dist-info}/top_level.txt +0 -0
|
Binary file
|
nexaai/_version.py
CHANGED
|
Binary file
|
|
@@ -80,6 +80,9 @@ class VLM(ProfilingMixin):
|
|
|
80
80
|
|
|
81
81
|
# Init deafutl sampler config with defualt.
|
|
82
82
|
self.sampler_config = SamplerConfig()
|
|
83
|
+
|
|
84
|
+
# Track global character position for incremental processing
|
|
85
|
+
self.global_n_past_chars = 0
|
|
83
86
|
|
|
84
87
|
def destroy(self) -> None:
|
|
85
88
|
"""Destroy the model and free resources."""
|
|
@@ -89,6 +92,7 @@ class VLM(ProfilingMixin):
|
|
|
89
92
|
def reset(self) -> None:
|
|
90
93
|
"""Reset the model state."""
|
|
91
94
|
self._reset_cache()
|
|
95
|
+
self.global_n_past_chars = 0
|
|
92
96
|
|
|
93
97
|
def _reset_cache(self) -> None:
|
|
94
98
|
"""Reset the KV cache."""
|
|
@@ -141,6 +145,16 @@ class VLM(ProfilingMixin):
|
|
|
141
145
|
image_list = [str(path) for path in image_paths] if image_paths else None
|
|
142
146
|
audio_list = [str(path) for path in audio_paths] if audio_paths else None
|
|
143
147
|
|
|
148
|
+
# Extract incremental portion of the prompt (similar to llama.cpp VLM)
|
|
149
|
+
full_prompt_len = len(prompt)
|
|
150
|
+
incremental_prompt = prompt
|
|
151
|
+
|
|
152
|
+
if self.global_n_past_chars < full_prompt_len:
|
|
153
|
+
incremental_prompt = prompt[self.global_n_past_chars:]
|
|
154
|
+
else:
|
|
155
|
+
# No new text to process
|
|
156
|
+
incremental_prompt = ""
|
|
157
|
+
|
|
144
158
|
# End prompt processing, start decode
|
|
145
159
|
self._prompt_end()
|
|
146
160
|
self._decode_start()
|
|
@@ -152,7 +166,7 @@ class VLM(ProfilingMixin):
|
|
|
152
166
|
text, stats = generate(
|
|
153
167
|
self.model,
|
|
154
168
|
self.processor,
|
|
155
|
-
prompt
|
|
169
|
+
incremental_prompt, # Use incremental prompt instead of full prompt
|
|
156
170
|
image=image_list,
|
|
157
171
|
audio=audio_list,
|
|
158
172
|
**gen_kwargs,
|
|
@@ -181,6 +195,10 @@ class VLM(ProfilingMixin):
|
|
|
181
195
|
self._update_prompt_tokens(prompt_tokens)
|
|
182
196
|
self._update_generated_tokens(generated_tokens)
|
|
183
197
|
self._set_stop_reason(StopReason.ML_STOP_REASON_COMPLETED)
|
|
198
|
+
|
|
199
|
+
# Update global character position
|
|
200
|
+
self.global_n_past_chars = full_prompt_len + len(text)
|
|
201
|
+
|
|
184
202
|
self._decode_end()
|
|
185
203
|
self._end_profiling()
|
|
186
204
|
|
|
@@ -226,6 +244,16 @@ class VLM(ProfilingMixin):
|
|
|
226
244
|
image_list = [str(path) for path in image_paths] if image_paths else None
|
|
227
245
|
audio_list = [str(path) for path in audio_paths] if audio_paths else None
|
|
228
246
|
|
|
247
|
+
# Extract incremental portion of the prompt (similar to llama.cpp VLM)
|
|
248
|
+
full_prompt_len = len(prompt)
|
|
249
|
+
incremental_prompt = prompt
|
|
250
|
+
|
|
251
|
+
if self.global_n_past_chars < full_prompt_len:
|
|
252
|
+
incremental_prompt = prompt[self.global_n_past_chars:]
|
|
253
|
+
else:
|
|
254
|
+
# No new text to process
|
|
255
|
+
incremental_prompt = ""
|
|
256
|
+
|
|
229
257
|
# End prompt processing, start decode
|
|
230
258
|
self._prompt_end()
|
|
231
259
|
self._decode_start()
|
|
@@ -239,7 +267,7 @@ class VLM(ProfilingMixin):
|
|
|
239
267
|
for result in stream_generate_impl(
|
|
240
268
|
self.model,
|
|
241
269
|
self.processor,
|
|
242
|
-
prompt
|
|
270
|
+
incremental_prompt, # Use incremental prompt instead of full prompt
|
|
243
271
|
image=image_list,
|
|
244
272
|
audio=audio_list,
|
|
245
273
|
**gen_kwargs,
|
|
@@ -266,6 +294,9 @@ class VLM(ProfilingMixin):
|
|
|
266
294
|
self._update_prompt_tokens(last_result.prompt_tokens)
|
|
267
295
|
self._update_generated_tokens(last_result.generation_tokens)
|
|
268
296
|
|
|
297
|
+
# Update global character position
|
|
298
|
+
self.global_n_past_chars = full_prompt_len + len(text)
|
|
299
|
+
|
|
269
300
|
self._decode_end()
|
|
270
301
|
self._end_profiling()
|
|
271
302
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
nexaai/__init__.py,sha256=L8oB7GFZZMGnUpCg0PecDbI_ycKuQak-ZEJ4Y12_QIw,2184
|
|
2
|
-
nexaai/_stub.cpython-310-darwin.so,sha256=
|
|
3
|
-
nexaai/_version.py,sha256=
|
|
2
|
+
nexaai/_stub.cpython-310-darwin.so,sha256=1MI3uHUVNVIQVLFKAtgfjobGzVmoWw57EV8bIn3rEXQ,49832
|
|
3
|
+
nexaai/_version.py,sha256=rKQTMRjwBe37A1MYCov01rf2P607gRZoI-XbYCSIcoA,143
|
|
4
4
|
nexaai/asr.py,sha256=NljMXDErwPNMOPaRkJZMEDka9Nk8xyur7L8i924TStY,2054
|
|
5
5
|
nexaai/base.py,sha256=N8PRgDFA-XPku2vWnQIofQ7ipz3pPlO6f8YZGnuhquE,982
|
|
6
6
|
nexaai/common.py,sha256=Y0NJNLTi4Nq4x1WL6PQsSvGUto0eGmWhjpsC6jcekfA,3444
|
|
@@ -19,7 +19,7 @@ nexaai/asr_impl/pybind_asr_impl.py,sha256=pE9Hb_hMi5yAc4MF83bLVOb8zDtreCkB3_u7XE
|
|
|
19
19
|
nexaai/binds/__init__.py,sha256=eYuay_8DDXeOUWz2_R9HFSabohxs6hvZn391t2L0Po0,104
|
|
20
20
|
nexaai/binds/common_bind.cpython-310-darwin.so,sha256=km1TU5WOJHVjvyM4l5mgAkS_omxuKt8pM92E9Wv0VqM,235488
|
|
21
21
|
nexaai/binds/embedder_bind.cpython-310-darwin.so,sha256=b2NoXFAJvPLi_P1X7lXLKmAUU0v2HJI3Zwa10gfqHdw,202032
|
|
22
|
-
nexaai/binds/libnexa_bridge.dylib,sha256=
|
|
22
|
+
nexaai/binds/libnexa_bridge.dylib,sha256=e65bAG4luP6zSI6Zvdl3UqlQK36ynJ5Jr2aceMIlXK8,250408
|
|
23
23
|
nexaai/binds/llm_bind.cpython-310-darwin.so,sha256=p1ZTGMolEkWywkmwzOUjTr3RpSEH21BHZAggVzo89Ks,183088
|
|
24
24
|
nexaai/binds/vlm_bind.cpython-310-darwin.so,sha256=LGd-tykePnQFfGca25HnPIBfXsfrMzbwyx6d5Ld3xps,183000
|
|
25
25
|
nexaai/binds/nexa_llama_cpp/libggml-base.dylib,sha256=GyOkHOM-5uHp7NUZ4Sr9BWak6BYpcc9aqI9A-zPnQp4,629528
|
|
@@ -247,7 +247,7 @@ nexaai/mlx_backend/tts/interface.py,sha256=0FvZbIyOvg8jERZEQ6bygbv7v02O9xHO4-TPU
|
|
|
247
247
|
nexaai/mlx_backend/vlm/__init__.py,sha256=_25kvMEviX16Hg3bro8Ws70V0eeIEqYKV8ZDXqYzKew,73
|
|
248
248
|
nexaai/mlx_backend/vlm/generate.py,sha256=DqHFEAuqk-nko8ho6U9GAXTDAWz4d8GTe_hCt-XFyCw,19071
|
|
249
249
|
nexaai/mlx_backend/vlm/generate_qwen3_vl.py,sha256=undjso1mfxqpd6FMTksSA5qagRttxAGbOBj1x7cqI1s,9211
|
|
250
|
-
nexaai/mlx_backend/vlm/interface.py,sha256=
|
|
250
|
+
nexaai/mlx_backend/vlm/interface.py,sha256=0BLfodbYOU71jFvAvv01FuLBE_KBtyB-8Cd7LqzzRHY,17450
|
|
251
251
|
nexaai/mlx_backend/vlm/main.py,sha256=nPcg25jupeDD74uvRoxpWp3Dsulw7WddI7vll6zejak,10664
|
|
252
252
|
nexaai/mlx_backend/vlm/modeling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
253
253
|
nexaai/mlx_backend/vlm/modeling/convert.py,sha256=ia5i9cgTufFGmKyhkYUaW0nfNqT_bMo8i-Hg_zy5JC4,1863
|
|
@@ -388,7 +388,7 @@ nexaai/utils/quantization_utils.py,sha256=FYcNSAKGlBqFDUTx3jSKOr2lnq4nyiyC0ZG8oS
|
|
|
388
388
|
nexaai/vlm_impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
389
389
|
nexaai/vlm_impl/mlx_vlm_impl.py,sha256=pLtWm_ckz8a0U-AtAOMVseFDO4OVPvHyYO2KlfBaGYk,10833
|
|
390
390
|
nexaai/vlm_impl/pybind_vlm_impl.py,sha256=FAbhpRJzHgI78r0mUvKybO97R1szvNhH0aTn_I52oT4,8597
|
|
391
|
-
nexaai-1.0.
|
|
392
|
-
nexaai-1.0.
|
|
393
|
-
nexaai-1.0.
|
|
394
|
-
nexaai-1.0.
|
|
391
|
+
nexaai-1.0.17rc1.dist-info/METADATA,sha256=-o225-FK1Adyvf4f8tzZM7FMyeq9g9CJthuqKuNKvG4,1201
|
|
392
|
+
nexaai-1.0.17rc1.dist-info/WHEEL,sha256=0KYp5feZ1CMUhsfFXKpSQTbSmQbXy4mv6yPPVBXg2EM,110
|
|
393
|
+
nexaai-1.0.17rc1.dist-info/top_level.txt,sha256=LRE2YERlrZk2vfuygnSzsEeqSknnZbz3Z1MHyNmBU4w,7
|
|
394
|
+
nexaai-1.0.17rc1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|