nexaai 1.0.19rc3__cp310-cp310-win_amd64.whl → 1.0.19rc5__cp310-cp310-win_amd64.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-rc3"
4
+ __version__ = "1.0.19-rc5"
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -332,8 +332,133 @@ def create_mlx_manifest(repo_id: str, files: List[str], directory_path: str, old
332
332
  return manifest
333
333
 
334
334
 
335
- def detect_model_type(files: List[str]) -> str:
336
- """Detect if this is a GGUF or MLX model based on file extensions."""
335
+ def create_npu_manifest(repo_id: str, files: List[str], directory_path: str, old_metadata: Dict[str, Any], is_mmproj: bool = False, file_name: Optional[Union[str, List[str]]] = None, **kwargs) -> Dict[str, Any]:
336
+ """Create NPU format manifest."""
337
+
338
+ # Load existing manifest to merge NPU files if it exists
339
+ existing_manifest = load_nexa_manifest(directory_path)
340
+
341
+ # Check if there's a downloaded nexa.manifest from the repo
342
+ downloaded_manifest = old_metadata.get('downloaded_manifest', {})
343
+
344
+ model_files = {}
345
+ extra_files = []
346
+
347
+ # Initialize MMProjFile
348
+ mmproj_file = {
349
+ "Name": "",
350
+ "Downloaded": False,
351
+ "Size": 0
352
+ }
353
+
354
+ for current_file_name in files:
355
+ file_path = os.path.join(directory_path, current_file_name)
356
+ file_size = 0
357
+ if os.path.exists(file_path):
358
+ try:
359
+ file_size = os.path.getsize(file_path)
360
+ except (OSError, IOError):
361
+ pass
362
+
363
+ # Check if this file is an mmproj file
364
+ is_current_mmproj = 'mmproj' in current_file_name.lower()
365
+
366
+ # If we're downloading specific files and this is marked as mmproj, respect that
367
+ if is_mmproj and file_name is not None:
368
+ filenames_to_check = file_name if isinstance(file_name, list) else [file_name]
369
+ is_current_mmproj = current_file_name in filenames_to_check
370
+
371
+ if is_current_mmproj:
372
+ # This is an mmproj file, put it in MMProjFile
373
+ mmproj_file = {
374
+ "Name": current_file_name,
375
+ "Downloaded": True,
376
+ "Size": file_size
377
+ }
378
+ else:
379
+ # For NPU, all non-mmproj files go to extra_files
380
+ extra_files.append({
381
+ "Name": current_file_name,
382
+ "Downloaded": True,
383
+ "Size": file_size
384
+ })
385
+
386
+ # Pick the first file from extra_files and add it to ModelFile with key "N/A"
387
+ if extra_files:
388
+ first_file = extra_files[0]
389
+ model_files["N/A"] = {
390
+ "Name": first_file["Name"],
391
+ "Downloaded": first_file["Downloaded"],
392
+ "Size": first_file["Size"]
393
+ }
394
+
395
+ # Determine PluginId with priority: kwargs > downloaded_manifest > model_file_type > default
396
+ plugin_id = kwargs.get('plugin_id')
397
+ if not plugin_id:
398
+ model_file_type = old_metadata.get('model_file_type')
399
+ if downloaded_manifest.get('PluginId'):
400
+ plugin_id = downloaded_manifest.get('PluginId')
401
+ elif model_file_type:
402
+ plugin_id = _get_plugin_id_from_model_file_type(model_file_type)
403
+ else:
404
+ plugin_id = "npu"
405
+
406
+ # Determine ModelType with priority: kwargs > downloaded_manifest > pipeline_tag mapping
407
+ model_type = kwargs.get('model_type')
408
+ if not model_type:
409
+ if downloaded_manifest.get('ModelType'):
410
+ model_type = downloaded_manifest.get('ModelType')
411
+ else:
412
+ model_type = PIPELINE_TO_MODEL_TYPE.get(old_metadata.get('pipeline_tag'), "other")
413
+
414
+ # Determine ModelName with priority: kwargs > downloaded_manifest > empty string
415
+ model_name = kwargs.get('model_name')
416
+ if not model_name:
417
+ model_name = downloaded_manifest.get('ModelName', '')
418
+
419
+ # Get DeviceId and MinSDKVersion from kwargs or default to empty string
420
+ device_id = kwargs.get('device_id', '')
421
+ min_sdk_version = kwargs.get('min_sdk_version', '')
422
+
423
+ manifest = {
424
+ "Name": repo_id,
425
+ "ModelName": model_name,
426
+ "ModelType": model_type,
427
+ "PluginId": plugin_id,
428
+ "DeviceId": device_id,
429
+ "MinSDKVersion": min_sdk_version,
430
+ "ModelFile": model_files,
431
+ "MMProjFile": mmproj_file,
432
+ "TokenizerFile": {
433
+ "Name": "",
434
+ "Downloaded": False,
435
+ "Size": 0
436
+ },
437
+ "ExtraFiles": extra_files if extra_files else None,
438
+ # Preserve old metadata fields
439
+ "pipeline_tag": old_metadata.get('pipeline_tag') if old_metadata.get('pipeline_tag') else existing_manifest.get('pipeline_tag'),
440
+ "download_time": old_metadata.get('download_time') if old_metadata.get('download_time') else existing_manifest.get('download_time'),
441
+ "avatar_url": old_metadata.get('avatar_url') if old_metadata.get('avatar_url') else existing_manifest.get('avatar_url')
442
+ }
443
+
444
+ return manifest
445
+
446
+
447
+ def detect_model_type(files: List[str], old_metadata: Dict[str, Any] = None) -> str:
448
+ """Detect if this is a GGUF, MLX, or NPU model based on file extensions and metadata.
449
+
450
+ Args:
451
+ files: List of files in the model directory
452
+ old_metadata: Metadata dict that may contain 'model_file_type'
453
+
454
+ Returns:
455
+ Model type string: 'gguf', 'mlx', or 'npu'
456
+ """
457
+ # Check if model_file_type is explicitly set to NPU
458
+ if old_metadata and old_metadata.get('model_file_type') == 'npu':
459
+ return "npu"
460
+
461
+ # Otherwise, detect based on file extensions
337
462
  has_gguf = any(f.endswith('.gguf') for f in files)
338
463
  has_safetensors = any(f.endswith('.safetensors') or 'safetensors' in f for f in files)
339
464
 
@@ -354,7 +479,7 @@ def create_manifest_from_files(repo_id: str, files: List[str], directory_path: s
354
479
  repo_id: Repository ID
355
480
  files: List of files in the model directory
356
481
  directory_path: Path to the model directory
357
- old_metadata: Existing metadata (pipeline_tag, download_time, avatar_url)
482
+ old_metadata: Existing metadata (pipeline_tag, download_time, avatar_url, model_file_type)
358
483
  is_mmproj: Whether the downloaded file is an mmproj file
359
484
  file_name: The specific file(s) that were downloaded (None if entire repo was downloaded)
360
485
  **kwargs: Additional metadata including plugin_id, model_name, model_type, device_id, min_sdk_version
@@ -362,10 +487,12 @@ def create_manifest_from_files(repo_id: str, files: List[str], directory_path: s
362
487
  Returns:
363
488
  Dict containing the appropriate manifest format
364
489
  """
365
- model_type = detect_model_type(files)
490
+ model_type = detect_model_type(files, old_metadata)
366
491
 
367
492
  if model_type == "gguf":
368
493
  return create_gguf_manifest(repo_id, files, directory_path, old_metadata, is_mmproj, file_name, **kwargs)
494
+ elif model_type == "npu":
495
+ return create_npu_manifest(repo_id, files, directory_path, old_metadata, is_mmproj, file_name, **kwargs)
369
496
  else: # mlx or other
370
497
  return create_mlx_manifest(repo_id, files, directory_path, old_metadata, is_mmproj, file_name, **kwargs)
371
498
 
@@ -13,7 +13,7 @@ class ModelTypeMapping(Enum):
13
13
  """Enum for mapping HuggingFace pipeline_tag to our ModelType."""
14
14
  TEXT_GENERATION = ("text-generation", "llm")
15
15
  IMAGE_TEXT_TO_TEXT = ("image-text-to-text", "vlm")
16
- ANY_TO_ANY = ("any-to-any", "a2a")
16
+ ANY_TO_ANY = ("any-to-any", "ata")
17
17
  AUTOMATIC_SPEECH_RECOGNITION = ("automatic-speech-recognition", "asr")
18
18
 
19
19
  def __init__(self, pipeline_tag: str, model_type: str):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nexaai
3
- Version: 1.0.19rc3
3
+ Version: 1.0.19rc5
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=mbzzeXrEHHI_E3BQ0_OukD9wNajKJJVk0ykxT0rz8uM,2267
2
- nexaai/_stub.cp310-win_amd64.pyd,sha256=DK_lGFBFPokBVyhXVA57KeoAfTzs5GZgn8CtWvsjuic,10752
3
- nexaai/_version.py,sha256=LY9f-5sbVfTWqx5d_LzZ94-dCaIceXtAmIo_CA4iIrA,147
2
+ nexaai/_stub.cp310-win_amd64.pyd,sha256=g8IrnQpwLXtfvCaMSkK7w1nTXgacCO9Ukru1bVSfMxw,10752
3
+ nexaai/_version.py,sha256=WDIjg1ejoWwgXkkREVBfk6G6o2KIvnfke_TJsYv8bLU,147
4
4
  nexaai/asr.py,sha256=_fsGaxpiU137bUtO5ujtFSYCI1RLsyeEm3Gf4GhHVRk,2118
5
5
  nexaai/base.py,sha256=qQBCiQVNzgpkQjZX9aiFDEdbAAe56TROKC3WnWra2Zg,1021
6
6
  nexaai/common.py,sha256=muQqFY-WllwL5IO83tImexbuUcoEQsKg73u4gWL2lNs,3548
@@ -17,29 +17,29 @@ nexaai/asr_impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  nexaai/asr_impl/mlx_asr_impl.py,sha256=XwMX3LYMeulp8cDS0TCCYcjvttFHAyDWQ_oMvABwQmI,3349
18
18
  nexaai/asr_impl/pybind_asr_impl.py,sha256=20o5SOPzhF9x41ra8L_qIM7YxCkYeLb5csSrNde-dds,1560
19
19
  nexaai/binds/__init__.py,sha256=ENl-uoIF9-3XGIXitVgZ2QmJ6p7Yet4h1-X7nUDZ0Hk,108
20
- nexaai/binds/common_bind.cp310-win_amd64.pyd,sha256=17iVRFkeeLbOeCf78wAV9s78hstA1SIm3yrfp87QAwQ,205824
21
- nexaai/binds/embedder_bind.cp310-win_amd64.pyd,sha256=h3RijnqJPcZ_0pCAQjG2lw_YkvAvLZ0AHXl4GcBLc78,182784
20
+ nexaai/binds/common_bind.cp310-win_amd64.pyd,sha256=CvKV-HBp_smzCgo1P2nzb5d2-D5C4sSHDe5M6LRvjWE,205824
21
+ nexaai/binds/embedder_bind.cp310-win_amd64.pyd,sha256=XpNILL6lI5Q0IpqvudmShLwWvf4ffJb1ysthAMSGrFE,182784
22
22
  nexaai/binds/libcrypto-3-x64.dll,sha256=TAWcTdJrWviUingNyWaraOfz0ILUy7ybpI4VaiVHURg,7315968
23
23
  nexaai/binds/libssl-3-x64.dll,sha256=ZxawOWlONNM0Neg47w4JbU8kZJldj046H1zV3LiETa0,1313792
24
- nexaai/binds/llm_bind.cp310-win_amd64.pyd,sha256=khqmau0hyImkLdHCPUK9J3mC1mhztYrygn7tN63lLxM,162816
25
- nexaai/binds/nexa_bridge.dll,sha256=-nJnllhxJZAO-iVdJnrg-67673mW5EY2UX31VTUppbI,171520
26
- nexaai/binds/vlm_bind.cp310-win_amd64.pyd,sha256=keRgBUTi0eWjyG711CCDymQy4kjNr4EhulqWD3VrzPo,168960
27
- nexaai/binds/nexa_llama_cpp/ggml-base.dll,sha256=Edf5NoZg7LFw9oOAYe26xbBustCNt0vazwv8-Z5kIhM,532480
28
- nexaai/binds/nexa_llama_cpp/ggml-cpu.dll,sha256=K4nNzOUHrOGqGlDzzoYBDXHUrbIpJlA9vHsvZPFr8xM,672768
29
- nexaai/binds/nexa_llama_cpp/ggml-cuda.dll,sha256=6vQjreOenF24RgscpFYbaWq0Cfjr4yaHAtofbBR2VKI,313528832
30
- nexaai/binds/nexa_llama_cpp/ggml-vulkan.dll,sha256=jYZpZJcw327V7qmTKGD2BzgeSyPmJTAhistq7PKBE_s,36627456
31
- nexaai/binds/nexa_llama_cpp/ggml.dll,sha256=Tj1ITrEBcph6o2fYkNwfyRYnws_hwCvGAiSS4dTs7Ms,66560
32
- nexaai/binds/nexa_llama_cpp/llama.dll,sha256=mA81ecEnsKB6fziVe8u-Tm43emPql9AXIENUDjojqKU,1611776
33
- nexaai/binds/nexa_llama_cpp/mtmd.dll,sha256=tdIeXzE_V3u1HJy6tQ5m2bNeUNzOKjZ-ynogyfIzL3c,561152
34
- nexaai/binds/nexa_llama_cpp/nexa_plugin.dll,sha256=DxgLUn2qjvPTx3yOwMvIhoiW37guWhXINaChnJYb0tY,1410560
35
- nexaai/binds/nexa_nexaml/ggml-base.dll,sha256=Edf5NoZg7LFw9oOAYe26xbBustCNt0vazwv8-Z5kIhM,532480
36
- nexaai/binds/nexa_nexaml/ggml-cpu.dll,sha256=K4nNzOUHrOGqGlDzzoYBDXHUrbIpJlA9vHsvZPFr8xM,672768
37
- nexaai/binds/nexa_nexaml/ggml-cuda.dll,sha256=6vQjreOenF24RgscpFYbaWq0Cfjr4yaHAtofbBR2VKI,313528832
38
- nexaai/binds/nexa_nexaml/ggml-vulkan.dll,sha256=jYZpZJcw327V7qmTKGD2BzgeSyPmJTAhistq7PKBE_s,36627456
39
- nexaai/binds/nexa_nexaml/ggml.dll,sha256=Tj1ITrEBcph6o2fYkNwfyRYnws_hwCvGAiSS4dTs7Ms,66560
24
+ nexaai/binds/llm_bind.cp310-win_amd64.pyd,sha256=SJBT4gkBuFTAgRzH0h_vbOxaLFU_EMupx7_mgJGM-cU,162816
25
+ nexaai/binds/nexa_bridge.dll,sha256=RFCnOI0Ih9Rikl6l4HKZ0vcgxd91pz1LzuYOJeEq7X4,171520
26
+ nexaai/binds/vlm_bind.cp310-win_amd64.pyd,sha256=bYGrwBUe4Z30NHpYN_tdS-FpNIxqoCgR_mUsDr3E8_g,168960
27
+ nexaai/binds/nexa_llama_cpp/ggml-base.dll,sha256=677Ft5_Ds0ngZETxDyc4X8CCnqxLuGGJad60_Vl1yGU,532480
28
+ nexaai/binds/nexa_llama_cpp/ggml-cpu.dll,sha256=lKv6PkpYvPfZ4oV3VAg1195Kv_uw9SXT6ikXEVQpIts,672768
29
+ nexaai/binds/nexa_llama_cpp/ggml-cuda.dll,sha256=hJDbuNOUFuVUwKUu4_sm400OdZjwtAQvj_oimnBPo4U,313528832
30
+ nexaai/binds/nexa_llama_cpp/ggml-vulkan.dll,sha256=v8PEoxhgdZlCFlKuNBhaoryjJJkEduzAou_0KrMVMx4,36627456
31
+ nexaai/binds/nexa_llama_cpp/ggml.dll,sha256=1529huIN8Yy6sdf3-oBa_9wh3HpZ4g80NyH6Hbu5j2U,66560
32
+ nexaai/binds/nexa_llama_cpp/llama.dll,sha256=SUHvBhIisRvdwD1SIGlnyPbTvlZPcp6ZBD7NbgAthbo,1611776
33
+ nexaai/binds/nexa_llama_cpp/mtmd.dll,sha256=MsQtyiIjVgd9l4QQwKiWiftx14Ts3heqwCxIk2gbRNg,561152
34
+ nexaai/binds/nexa_llama_cpp/nexa_plugin.dll,sha256=LAR81WMBhwdLktBBVDioGJqPEu2ZiBlgkldadgqJbTY,1410560
35
+ nexaai/binds/nexa_nexaml/ggml-base.dll,sha256=677Ft5_Ds0ngZETxDyc4X8CCnqxLuGGJad60_Vl1yGU,532480
36
+ nexaai/binds/nexa_nexaml/ggml-cpu.dll,sha256=lKv6PkpYvPfZ4oV3VAg1195Kv_uw9SXT6ikXEVQpIts,672768
37
+ nexaai/binds/nexa_nexaml/ggml-cuda.dll,sha256=hJDbuNOUFuVUwKUu4_sm400OdZjwtAQvj_oimnBPo4U,313528832
38
+ nexaai/binds/nexa_nexaml/ggml-vulkan.dll,sha256=v8PEoxhgdZlCFlKuNBhaoryjJJkEduzAou_0KrMVMx4,36627456
39
+ nexaai/binds/nexa_nexaml/ggml.dll,sha256=1529huIN8Yy6sdf3-oBa_9wh3HpZ4g80NyH6Hbu5j2U,66560
40
40
  nexaai/binds/nexa_nexaml/nexa-mm-process.dll,sha256=oDnqTaAUeZrWJePQEDuIYKEOMP-ndu221mMFHht4bSY,4642816
41
41
  nexaai/binds/nexa_nexaml/nexa-sampling.dll,sha256=PNtidsRbGO8dTfbf7-VMdhQRbF328yvLnmDjMy2Tb7Y,4265984
42
- nexaai/binds/nexa_nexaml/nexa_plugin.dll,sha256=zLtRlgpQZKZJfoo9zzwLC4W6-qSvgr8Nb2NgV5zbgrM,602112
42
+ nexaai/binds/nexa_nexaml/nexa_plugin.dll,sha256=PCDWGdMfKbJcglDRk8gr4vZqDLBlQabcAytQUuSwDfM,602112
43
43
  nexaai/binds/nexa_nexaml/nexaproc.dll,sha256=9X4TF6p7wOiIXi_SA7uHLoEmrvcTlH2WpfijK7HxZgY,2668544
44
44
  nexaai/binds/nexa_nexaml/qwen3-vl.dll,sha256=Es-etUDiMmK_BwOki8V79Nja-NY4kBbrkhtnesXfMMU,5870592
45
45
  nexaai/binds/nexa_nexaml/qwen3vl-vision.dll,sha256=HFAk0FxWlf_lko3AQL6uBXTIhm6AzDFi5PjxI0lxONI,1184256
@@ -62,15 +62,15 @@ nexaai/tts_impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  nexaai/tts_impl/mlx_tts_impl.py,sha256=LcH9bVdIl3Q6lOzSUB_X2s-_nWFmlCl1yL7XSUK0fYI,3195
63
63
  nexaai/tts_impl/pybind_tts_impl.py,sha256=n3z4zmPQayQJgAwcvETw0IBUCp8IYROuYFSg0tAy_8Y,1487
64
64
  nexaai/utils/decode.py,sha256=0Z9jDH4ICzw4YXj8nD4L-sMouDaev-TISGRQ4KzidWE,421
65
- nexaai/utils/manifest_utils.py,sha256=7IQAIrv2vgOI7wVZfavQ4282uve7qNDOKZwmfOBCAE0,16595
65
+ nexaai/utils/manifest_utils.py,sha256=E07t_bNq-EDrqVYZW7uyX8zsKsFklvqqwSvic0in0tQ,21800
66
66
  nexaai/utils/model_manager.py,sha256=qzlGP4sZLYsO72vg-EUCVA0RUknVKtLYMmDDfPmG45g,60999
67
- nexaai/utils/model_types.py,sha256=hwQbxatmlXF9v_XxhcofYbglnmXzxUh4yYbBV2p1OSU,1532
67
+ nexaai/utils/model_types.py,sha256=q2m7diYLOpLvRl1ixL2eMq5_kdTj8KqPBGWX4p6Ob08,1532
68
68
  nexaai/utils/progress_tracker.py,sha256=BztrFqtjwNUmeREwZ5m7H6ZcrVzQEbpZfsxndWh4z0A,15778
69
69
  nexaai/utils/quantization_utils.py,sha256=FxnZ6-uAE_bl_vQ5jsRXlpU0NBn-U4Y8iN9_O6aCdPA,8070
70
70
  nexaai/vlm_impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
71
  nexaai/vlm_impl/mlx_vlm_impl.py,sha256=MgqJO7OzuPd79gOZZKhSXXMNSP2eBuhhrdCX8XHn6aQ,11090
72
72
  nexaai/vlm_impl/pybind_vlm_impl.py,sha256=NuQ_Ep1TnjmGAkjJuUS0Lb6z7iPu3wroLVOx7kiAwlE,8827
73
- nexaai-1.0.19rc3.dist-info/METADATA,sha256=aclbMXHwmr7l7eIkuuM-3Z7K2cWKZYAIxj0zofXxWrk,1233
74
- nexaai-1.0.19rc3.dist-info/WHEEL,sha256=KUuBC6lxAbHCKilKua8R9W_TM71_-9Sg5uEP3uDWcoU,101
75
- nexaai-1.0.19rc3.dist-info/top_level.txt,sha256=LRE2YERlrZk2vfuygnSzsEeqSknnZbz3Z1MHyNmBU4w,7
76
- nexaai-1.0.19rc3.dist-info/RECORD,,
73
+ nexaai-1.0.19rc5.dist-info/METADATA,sha256=oYOS0eZu_QQLgmfgjtRHH8xWGY4LaxWMghnuCIqJBTY,1233
74
+ nexaai-1.0.19rc5.dist-info/WHEEL,sha256=KUuBC6lxAbHCKilKua8R9W_TM71_-9Sg5uEP3uDWcoU,101
75
+ nexaai-1.0.19rc5.dist-info/top_level.txt,sha256=LRE2YERlrZk2vfuygnSzsEeqSknnZbz3Z1MHyNmBU4w,7
76
+ nexaai-1.0.19rc5.dist-info/RECORD,,