nexaai 1.0.19rc7__cp310-cp310-macosx_13_0_x86_64.whl → 1.0.19rc9__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.

Binary file
nexaai/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # This file is generated by CMake from _version.py.in
2
2
  # Do not modify this file manually - it will be overwritten
3
3
 
4
- __version__ = "1.0.19-rc7"
4
+ __version__ = "1.0.19-rc9"
Binary file
@@ -1,6 +1,5 @@
1
1
  import argparse
2
2
  import json
3
- import sys
4
3
  import os
5
4
  import mlx.core as mx
6
5
  import mlx.nn as nn
@@ -10,38 +9,21 @@ import requests
10
9
  import numpy as np
11
10
  from pathlib import Path
12
11
  from huggingface_hub import snapshot_download
13
-
14
- # Add current directory to path for imports
15
- curr_dir = os.path.dirname(os.path.abspath(__file__))
16
- sys.path.append(curr_dir)
17
- sys.path.append(os.path.dirname(curr_dir))
18
-
19
- # Add the qwen3vl model directory to path
20
- qwen3vl_dir = os.path.join(curr_dir, "modeling", "models", "qwen3_vl")
21
- sys.path.append(qwen3vl_dir)
12
+ from dataclasses import dataclass
13
+ from typing import Any, Generator, List, Optional, Sequence, Tuple, Union
22
14
 
23
15
  # Import required modules for quantized loading
24
16
  from transformers import AutoTokenizer
25
17
 
26
- # Try relative imports first, fallback to sys.path approach for Nuitka compatibility
27
- try:
28
- from .modeling.models.qwen3_vl.llm_common.generate import nexa_generate_step
29
- from .modeling.models.qwen3_vl.llm_common.cache import make_prompt_cache
30
- from .modeling.models.qwen3_vl.qwen3vl import (
31
- VEGModel, LLMModel, ModelArgs, VisionConfig, TextConfig, handle_multimodal_embeds
32
- )
33
- from .modeling.models.qwen3_vl.processor import Qwen3VLProcessor
34
- except ImportError:
35
- # Fallback for Nuitka compiled environment - use sys.path approach
36
- from llm_common.generate import nexa_generate_step
37
- from llm_common.cache import make_prompt_cache
38
- from qwen3vl import VEGModel, LLMModel, ModelArgs, VisionConfig, TextConfig, handle_multimodal_embeds
39
- from processor import Qwen3VLProcessor
40
-
41
- from ml import ChatMessage
42
- from dataclasses import dataclass
43
- from typing import Any, Generator, List, Optional, Sequence, Tuple, Union
18
+ # Import from the nested modeling structure
19
+ from .modeling.models.qwen3_vl.llm_common.generate import nexa_generate_step
20
+ from .modeling.models.qwen3_vl.llm_common.cache import make_prompt_cache
21
+ from .modeling.models.qwen3_vl.qwen3vl import (
22
+ VEGModel, LLMModel, ModelArgs, VisionConfig, TextConfig, handle_multimodal_embeds
23
+ )
24
+ from .modeling.models.qwen3_vl.processor import Qwen3VLProcessor
44
25
  from .generate import GenerationResult
26
+ from ml import ChatMessage
45
27
 
46
28
  # Custom exception for context length exceeded
47
29
  class ContextLengthExceededError(Exception):
@@ -79,10 +61,11 @@ def load_qwen3_vl(
79
61
  model_path = Path(snapshot_download(
80
62
  repo_id=path_or_repo, repo_type="model", revision=revision))
81
63
  else:
82
- # Fallback to local modelfiles directory
83
- model_path = Path(qwen3vl_dir) / "modelfiles"
64
+ # Fallback to local modelfiles directory relative to this file
65
+ curr_dir = Path(__file__).parent
66
+ model_path = curr_dir / "modeling" / "models" / "qwen3_vl" / "modelfiles"
84
67
  if not model_path.exists():
85
- model_path = Path(curr_dir) / "modelfiles"
68
+ model_path = curr_dir / "modelfiles"
86
69
 
87
70
  # Model configs (kept identical to main)
88
71
  vision_config = VisionConfig(
@@ -1,6 +1,5 @@
1
1
  import argparse
2
2
  import json
3
- import sys
4
3
  import os
5
4
  import mlx.core as mx
6
5
  import mlx.nn as nn
@@ -10,38 +9,21 @@ import requests
10
9
  import numpy as np
11
10
  from pathlib import Path
12
11
  from huggingface_hub import snapshot_download
13
-
14
- # Add current directory to path for imports
15
- curr_dir = os.path.dirname(os.path.abspath(__file__))
16
- sys.path.append(curr_dir)
17
- sys.path.append(os.path.dirname(curr_dir))
18
-
19
- # Add the qwen3vl model directory to path
20
- qwen3vl_dir = os.path.join(curr_dir, "modeling", "models", "qwen3vl_moe")
21
- sys.path.append(qwen3vl_dir)
12
+ from dataclasses import dataclass
13
+ from typing import Any, Generator, List, Optional, Sequence, Tuple, Union
22
14
 
23
15
  # Import required modules for quantized loading
24
16
  from transformers import AutoTokenizer
25
17
 
26
- # Try relative imports first, fallback to sys.path approach for Nuitka compatibility
27
- try:
28
- from .modeling.models.qwen3_vl_moe.llm_common.generate import nexa_generate_step
29
- from .modeling.models.qwen3_vl_moe.llm_common.cache import make_prompt_cache
30
- from .modeling.models.qwen3_vl_moe.qwen3vl_moe import (
31
- VEGModel, LLMModel, ModelArgs, VisionConfig, TextConfig, handle_multimodal_embeds
32
- )
33
- from .modeling.models.qwen3_vl_moe.processor import Qwen3VLProcessor
34
- except ImportError:
35
- # Fallback for Nuitka compiled environment - use sys.path approach
36
- from llm_common.generate import nexa_generate_step
37
- from llm_common.cache import make_prompt_cache
38
- from qwen3vl_moe import VEGModel, LLMModel, ModelArgs, VisionConfig, TextConfig, handle_multimodal_embeds
39
- from processor import Qwen3VLProcessor
40
-
41
- from ml import ChatMessage
42
- from dataclasses import dataclass
43
- from typing import Any, Generator, List, Optional, Sequence, Tuple, Union
44
- from .generate import GenerationResult
18
+ # Import from the nested modeling structure
19
+ from .modeling.models.qwen3vl_moe.llm_common.generate import nexa_generate_step
20
+ from .modeling.models.qwen3vl_moe.llm_common.cache import make_prompt_cache
21
+ from .modeling.models.qwen3vl_moe.qwen3vl_moe import (
22
+ VEGModel, LLMModel, ModelArgs, VisionConfig, TextConfig, handle_multimodal_embeds
23
+ )
24
+ from .modeling.models.qwen3vl_moe.processor import Qwen3VLProcessor
25
+ from .generate import GenerationResult
26
+ from ml import ChatMessage
45
27
 
46
28
  @dataclass
47
29
  class Qwen3VLBundledModel:
@@ -73,10 +55,11 @@ def load_qwen3_vl(
73
55
  model_path = Path(snapshot_download(
74
56
  repo_id=path_or_repo, repo_type="model", revision=revision))
75
57
  else:
76
- # Fallback to local modelfiles directory
77
- model_path = Path(qwen3vl_dir) / "modelfiles"
58
+ # Fallback to local modelfiles directory relative to this file
59
+ curr_dir = Path(__file__).parent
60
+ model_path = curr_dir / "modeling" / "models" / "qwen3vl_moe" / "modelfiles"
78
61
  if not model_path.exists():
79
- model_path = Path(curr_dir) / "modelfiles"
62
+ model_path = curr_dir / "modelfiles"
80
63
 
81
64
  # Model configs - Updated to match Qwen3VL-MoE specifications
82
65
  vision_config = VisionConfig(
@@ -8,29 +8,13 @@ import mlx.nn as nn
8
8
  import math
9
9
  import numpy as np
10
10
 
11
- import os
12
- import sys
13
-
14
- curr_dir = os.path.dirname(os.path.abspath(__file__))
15
- llm_common_dir = os.path.join(curr_dir, "..", "..")
16
- sys.path.append(llm_common_dir)
17
-
18
- # Try relative imports first, fallback to sys.path approach for Nuitka compatibility
19
- try:
20
- from .llm_common.base import (
21
- BaseModelArgs,
22
- create_attention_mask,
23
- scaled_dot_product_attention,
24
- )
25
- from .llm_common.rope_utils import initialize_rope
26
- except ImportError:
27
- # Fallback for Nuitka compiled environment
28
- from llm_common.base import (
29
- BaseModelArgs,
30
- create_attention_mask,
31
- scaled_dot_product_attention,
32
- )
33
- from llm_common.rope_utils import initialize_rope
11
+ # Import from nested llm_common structure using relative imports
12
+ from .llm_common.base import (
13
+ BaseModelArgs,
14
+ create_attention_mask,
15
+ scaled_dot_product_attention,
16
+ )
17
+ from .llm_common.rope_utils import initialize_rope
34
18
 
35
19
 
36
20
  @dataclass
@@ -8,30 +8,14 @@ import mlx.nn as nn
8
8
  import math
9
9
  import numpy as np
10
10
 
11
- import os
12
- import sys
13
-
14
- curr_dir = os.path.dirname(os.path.abspath(__file__))
15
- llm_common_dir = os.path.join(curr_dir, "llm_common")
16
- sys.path.append(llm_common_dir)
17
-
18
- # Try relative imports first, fallback to sys.path approach for Nuitka compatibility
19
- try:
20
- from .llm_common.base import (
21
- BaseModelArgs,
22
- create_attention_mask,
23
- scaled_dot_product_attention,
24
- )
25
- from .llm_common.rope_utils import initialize_rope
26
- except ImportError:
27
- # Fallback for Nuitka compiled environment
28
- from llm_common.base import (
29
- BaseModelArgs,
30
- create_attention_mask,
31
- scaled_dot_product_attention,
32
- )
33
- from llm_common.rope_utils import initialize_rope
34
- from switch_layers import SwitchGLU
11
+ # Import from nested llm_common structure using relative imports
12
+ from .llm_common.base import (
13
+ BaseModelArgs,
14
+ create_attention_mask,
15
+ scaled_dot_product_attention,
16
+ )
17
+ from .llm_common.rope_utils import initialize_rope
18
+ from .switch_layers import SwitchGLU
35
19
 
36
20
 
37
21
  @dataclass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nexaai
3
- Version: 1.0.19rc7
3
+ Version: 1.0.19rc9
4
4
  Summary: Python bindings for NexaSDK C-lib backend
5
5
  Author-email: "Nexa AI, Inc." <dev@nexa.ai>
6
6
  Project-URL: Homepage, https://github.com/NexaAI/nexasdk-bridge
@@ -1,6 +1,6 @@
1
1
  nexaai/__init__.py,sha256=L8oB7GFZZMGnUpCg0PecDbI_ycKuQak-ZEJ4Y12_QIw,2184
2
- nexaai/_stub.cpython-310-darwin.so,sha256=vbOs5-ZQvO9yPa-MlefVTdYaripdKORrzPcH2zpd9_0,49832
3
- nexaai/_version.py,sha256=6idfoyE0rE2oVy8hJFBcYRNfoySV3pKNZpyB8HSD4ko,143
2
+ nexaai/_stub.cpython-310-darwin.so,sha256=X4Ayzpy-yKcxfF2Ag2w6V0jZuOMGavnB16kgBJJKXnU,49832
3
+ nexaai/_version.py,sha256=cBq07C7RkT85kn1w5XjXDE5IIdTu6Lg8iJ-tx2W_xdI,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=BoXByRlNGDaNS1YyZyCF-s7h0vXP9NLPlJMQQ5pqusU,235488
21
21
  nexaai/binds/embedder_bind.cpython-310-darwin.so,sha256=b2NoXFAJvPLi_P1X7lXLKmAUU0v2HJI3Zwa10gfqHdw,202032
22
- nexaai/binds/libnexa_bridge.dylib,sha256=-byGUclRGvlw6To4N0SjgtQyoQTLBKBuqhPUfU46ulw,251224
22
+ nexaai/binds/libnexa_bridge.dylib,sha256=kFyl0jt6NRkoJsRtz5hwZmfBy4eOnOFLoaHmJb3hupQ,251224
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=lARxdlzBWnBjYWAuQQF8utDbj_kX-J7RNxjrCiOQd2M,629760
@@ -246,8 +246,8 @@ nexaai/mlx_backend/tts/__init__.py,sha256=fuT_9_xpYJ28m4yjly5L2jChUrzlSQz-b_S7nu
246
246
  nexaai/mlx_backend/tts/interface.py,sha256=0FvZbIyOvg8jERZEQ6bygbv7v02O9xHO4-TPUlar0b4,9568
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
- nexaai/mlx_backend/vlm/generate_qwen3_vl.py,sha256=eeizW18u6dHPZOOnJtQUJkiqMAIIpOSS-IOjacXGsz4,10240
250
- nexaai/mlx_backend/vlm/generate_qwen3_vl_moe.py,sha256=Lcu1_I9FriRQF7TuFehjRWwVjEl6lA3eOWUGV2NQovk,9673
249
+ nexaai/mlx_backend/vlm/generate_qwen3_vl.py,sha256=NaVOU1kKRpkCClN5yV3_iL4aIe0V9LwqoKx-HI_xDNg,9590
250
+ nexaai/mlx_backend/vlm/generate_qwen3_vl_moe.py,sha256=ZSbM8JjTlkxUaVO9UNZM6YSbd60am3Z4ztJJEBsnJHg,9015
251
251
  nexaai/mlx_backend/vlm/interface.py,sha256=uTX5ifnMltDiFu5T4OgHCPNHf0E4gGUEFR8Bz-jnbds,19774
252
252
  nexaai/mlx_backend/vlm/main.py,sha256=pvNrMzgaYxw-uyQLj1k-OiAI6RdmNVxhxemEMXZSwUs,10829
253
253
  nexaai/mlx_backend/vlm/modeling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -359,7 +359,7 @@ nexaai/mlx_backend/vlm/modeling/models/qwen2_vl/language.py,sha256=OeUoAfIg7dNB4
359
359
  nexaai/mlx_backend/vlm/modeling/models/qwen2_vl/qwen2_vl.py,sha256=YysRg1PszpZdsH7hywqN2pIMZAbU1P636KZoSJCNri8,5740
360
360
  nexaai/mlx_backend/vlm/modeling/models/qwen2_vl/vision.py,sha256=rcneYZYwP5fx3p8xxXEDGvnWAMIn8DXenqBPLBjmVcI,10555
361
361
  nexaai/mlx_backend/vlm/modeling/models/qwen3_vl/processor.py,sha256=_WZK8uv0LAGHO8V5LwCojyS4UYk0tfICsZ9GM4_Pfxo,19156
362
- nexaai/mlx_backend/vlm/modeling/models/qwen3_vl/qwen3vl.py,sha256=LArnNtI98B_GJOblPNijVage9EmVfa-YZYI-2XGFZek,50662
362
+ nexaai/mlx_backend/vlm/modeling/models/qwen3_vl/qwen3vl.py,sha256=rlEJKxPb61bTEBeruqyfrAJtTf_wD0ey-kOmXhgdfVg,50199
363
363
  nexaai/mlx_backend/vlm/modeling/models/qwen3_vl/llm_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
364
364
  nexaai/mlx_backend/vlm/modeling/models/qwen3_vl/llm_common/base.py,sha256=4RlZwgz8YX2ngmJNaymxFFpw9hJu-0EMw9xwXpngW9o,3496
365
365
  nexaai/mlx_backend/vlm/modeling/models/qwen3_vl/llm_common/cache.py,sha256=NMOB6x-RT6svF4H-Ymo5WqnP7ptAal3aaKjWZXWGMsM,17671
@@ -368,7 +368,7 @@ nexaai/mlx_backend/vlm/modeling/models/qwen3_vl/llm_common/rope_utils.py,sha256=
368
368
  nexaai/mlx_backend/vlm/modeling/models/qwen3_vl/llm_common/sample_utils.py,sha256=8SEeVwgjuvaYy-4ALAU0RHQMuRr2k7EkXba_csxk498,10673
369
369
  nexaai/mlx_backend/vlm/modeling/models/qwen3_vl/llm_common/tokenizer_utils.py,sha256=Gqanx4hBDcon_k5ClhUsS4YpMbZNiee8jvImGS9h43s,13229
370
370
  nexaai/mlx_backend/vlm/modeling/models/qwen3vl_moe/processor.py,sha256=_WZK8uv0LAGHO8V5LwCojyS4UYk0tfICsZ9GM4_Pfxo,19156
371
- nexaai/mlx_backend/vlm/modeling/models/qwen3vl_moe/qwen3vl_moe.py,sha256=WTmNmkGe5YwTJEbwq44fh1LOhaekguPuSE1H89szj9Y,53856
371
+ nexaai/mlx_backend/vlm/modeling/models/qwen3vl_moe/qwen3vl_moe.py,sha256=OrrAQAPY_g5e7Pc8GSL94TXg-CEC8yL3MLDWNOVii-Q,53392
372
372
  nexaai/mlx_backend/vlm/modeling/models/qwen3vl_moe/switch_layers.py,sha256=6hjFCvIH8J1UBEPYaIg9HqSakyZgEEiQoJQ9E0WmZoM,5960
373
373
  nexaai/mlx_backend/vlm/modeling/models/qwen3vl_moe/llm_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
374
374
  nexaai/mlx_backend/vlm/modeling/models/qwen3vl_moe/llm_common/base.py,sha256=4RlZwgz8YX2ngmJNaymxFFpw9hJu-0EMw9xwXpngW9o,3496
@@ -398,7 +398,7 @@ nexaai/utils/quantization_utils.py,sha256=FYcNSAKGlBqFDUTx3jSKOr2lnq4nyiyC0ZG8oS
398
398
  nexaai/vlm_impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
399
399
  nexaai/vlm_impl/mlx_vlm_impl.py,sha256=pLtWm_ckz8a0U-AtAOMVseFDO4OVPvHyYO2KlfBaGYk,10833
400
400
  nexaai/vlm_impl/pybind_vlm_impl.py,sha256=FAbhpRJzHgI78r0mUvKybO97R1szvNhH0aTn_I52oT4,8597
401
- nexaai-1.0.19rc7.dist-info/METADATA,sha256=xfvVczRWdNhFztOjNjahKD3_DlvNAyBFV2gvVHnbEm4,1201
402
- nexaai-1.0.19rc7.dist-info/WHEEL,sha256=0KYp5feZ1CMUhsfFXKpSQTbSmQbXy4mv6yPPVBXg2EM,110
403
- nexaai-1.0.19rc7.dist-info/top_level.txt,sha256=LRE2YERlrZk2vfuygnSzsEeqSknnZbz3Z1MHyNmBU4w,7
404
- nexaai-1.0.19rc7.dist-info/RECORD,,
401
+ nexaai-1.0.19rc9.dist-info/METADATA,sha256=7gh05iEzIQGnTwbB2SedEAYdtSvLXP3m6U8BtkqkuGg,1201
402
+ nexaai-1.0.19rc9.dist-info/WHEEL,sha256=0KYp5feZ1CMUhsfFXKpSQTbSmQbXy4mv6yPPVBXg2EM,110
403
+ nexaai-1.0.19rc9.dist-info/top_level.txt,sha256=LRE2YERlrZk2vfuygnSzsEeqSknnZbz3Z1MHyNmBU4w,7
404
+ nexaai-1.0.19rc9.dist-info/RECORD,,