nexaai 1.0.21rc1__cp310-cp310-macosx_14_0_universal2.whl → 1.0.21rc2__cp310-cp310-macosx_14_0_universal2.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.21-rc1"
4
+ __version__ = "1.0.21-rc2"
Binary file
@@ -157,12 +157,16 @@ def create_gguf_manifest(repo_id: str, files: List[str], directory_path: str, ol
157
157
  # Use the new enum-based quantization extraction
158
158
  quantization_type = extract_quantization_from_filename(current_file_name)
159
159
  quant_level = quantization_type.value if quantization_type else "UNKNOWN"
160
-
161
- model_files[quant_level] = {
162
- "Name": current_file_name,
163
- "Downloaded": True,
164
- "Size": file_size
165
- }
160
+
161
+ # FIXME: hardcode to handle the multiple mmproj files problem
162
+ if quant_level == "UNKNOWN" and "mmproj" in current_file_name.lower():
163
+ pass
164
+ else:
165
+ model_files[quant_level] = {
166
+ "Name": current_file_name,
167
+ "Downloaded": True,
168
+ "Size": file_size
169
+ }
166
170
 
167
171
  # Determine PluginId with priority: kwargs > downloaded_manifest > model_file_type > default
168
172
  plugin_id = kwargs.get('plugin_id')
@@ -410,6 +410,20 @@ def _remove_specific_file(target_model: DownloadedModel, file_name: str, local_d
410
410
  except OSError:
411
411
  file_size = 0
412
412
 
413
+ # Check if we should remove entire folder instead (for .gguf files)
414
+ # If removing a .gguf file and no other non-mmproj .gguf files remain, remove entire folder
415
+ if file_name.endswith('.gguf'):
416
+ updated_files = [f for f in target_model.files if f != file_name]
417
+ # Find remaining .gguf files that don't contain "mmproj" in filename
418
+ remaining_non_mmproj_gguf = [
419
+ f for f in updated_files
420
+ if f.endswith('.gguf') and 'mmproj' not in f.lower()
421
+ ]
422
+
423
+ # If no non-mmproj .gguf files remain, remove entire repository
424
+ if len(remaining_non_mmproj_gguf) == 0:
425
+ return _remove_entire_repository(target_model, local_dir)
426
+
413
427
  # Remove the file
414
428
  try:
415
429
  os.remove(file_path)
@@ -846,6 +860,41 @@ class HuggingFaceDownloader:
846
860
  pass
847
861
  return {}
848
862
 
863
+ def _download_manifest_if_needed(self, repo_id: str, local_dir: str) -> bool:
864
+ """
865
+ Download nexa.manifest from the repository if it doesn't exist locally.
866
+
867
+ Args:
868
+ repo_id: Repository ID
869
+ local_dir: Local directory where the manifest should be saved
870
+
871
+ Returns:
872
+ bool: True if manifest was downloaded or already exists, False if not found in repo
873
+ """
874
+ manifest_path = os.path.join(local_dir, 'nexa.manifest')
875
+
876
+ # Check if manifest already exists locally
877
+ if os.path.exists(manifest_path):
878
+ return True
879
+
880
+ # Try to download nexa.manifest from the repository
881
+ try:
882
+ print(f"[INFO] Attempting to download nexa.manifest from {repo_id}...")
883
+ self.api.hf_hub_download(
884
+ repo_id=repo_id,
885
+ filename='nexa.manifest',
886
+ local_dir=local_dir,
887
+ local_dir_use_symlinks=False,
888
+ token=self.token,
889
+ force_download=False
890
+ )
891
+ print(f"[OK] Successfully downloaded nexa.manifest from {repo_id}")
892
+ return True
893
+ except Exception as e:
894
+ # Manifest doesn't exist in repo or other error - this is fine, we'll create it
895
+ print(f"[INFO] nexa.manifest not found in {repo_id}, will create locally")
896
+ return False
897
+
849
898
  def _fetch_and_save_metadata(self, repo_id: str, local_dir: str, is_mmproj: bool = False, file_name: Optional[Union[str, List[str]]] = None, **kwargs) -> None:
850
899
  """Fetch model info and save metadata after successful download."""
851
900
  # Initialize metadata with defaults to ensure manifest is always created
@@ -946,6 +995,9 @@ class HuggingFaceDownloader:
946
995
  if progress_tracker:
947
996
  progress_tracker.stop_tracking()
948
997
 
998
+ # Download nexa.manifest from repo if it doesn't exist locally
999
+ self._download_manifest_if_needed(repo_id, file_local_dir)
1000
+
949
1001
  # Save metadata after successful download
950
1002
  self._fetch_and_save_metadata(repo_id, file_local_dir, self._current_is_mmproj, self._current_file_name, **kwargs)
951
1003
 
@@ -1055,6 +1107,9 @@ class HuggingFaceDownloader:
1055
1107
  if progress_tracker:
1056
1108
  progress_tracker.stop_tracking()
1057
1109
 
1110
+ # Download nexa.manifest from repo if it doesn't exist locally
1111
+ self._download_manifest_if_needed(repo_id, repo_local_dir)
1112
+
1058
1113
  # Save metadata after successful download
1059
1114
  self._fetch_and_save_metadata(repo_id, repo_local_dir, self._current_is_mmproj, self._current_file_name, **kwargs)
1060
1115
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nexaai
3
- Version: 1.0.21rc1
3
+ Version: 1.0.21rc2
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=gOd7sNsqEESopw_24xgnOSkIRENrk4Fa-RMtmVv62eA,2421
2
- nexaai/_stub.cpython-310-darwin.so,sha256=DMnGNcPFvhY3a3UlfwjsnBARJK6Ms-g6tgwmrdUEpx4,66768
3
- nexaai/_version.py,sha256=sVSvlzCHN_LFLOFxO9UEdPfKi2BBoPi4MtOW-fdz1i8,143
2
+ nexaai/_stub.cpython-310-darwin.so,sha256=LZ_kiWiB-5-sIG2Nbsguqikf-DI3rSEqlsBjYZnrbQg,66768
3
+ nexaai/_version.py,sha256=rUlsUioGYFQcgW8x3C0Lhx4EJxLXKPkq0Tn9gN5475g,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
@@ -20,7 +20,7 @@ nexaai/asr_impl/pybind_asr_impl.py,sha256=pE9Hb_hMi5yAc4MF83bLVOb8zDtreCkB3_u7XE
20
20
  nexaai/binds/__init__.py,sha256=eYuay_8DDXeOUWz2_R9HFSabohxs6hvZn391t2L0Po0,104
21
21
  nexaai/binds/common_bind.cpython-310-darwin.so,sha256=zxJuD0nSV--VZKxBfWZUavU7_bHj_JTi0FhkjvG4VJw,235264
22
22
  nexaai/binds/embedder_bind.cpython-310-darwin.so,sha256=tPa0c0Dv_GiW66fgmAGWGCHXRGNApznqoQS0eQx9GFM,202064
23
- nexaai/binds/libnexa_bridge.dylib,sha256=l4Psl0JU6ki2K4oEA4EPmi01Fah55D8fc3eiEtfhIk4,272648
23
+ nexaai/binds/libnexa_bridge.dylib,sha256=64HB8Vvtyb3vIvbKQmo07Ae4hBtJn91fygCEUJT8bGI,272648
24
24
  nexaai/binds/llm_bind.cpython-310-darwin.so,sha256=TAWfa1Hzq00TjtC1xVsiAeLp6hv2LrL5afDz4omUghc,182784
25
25
  nexaai/binds/vlm_bind.cpython-310-darwin.so,sha256=VpTl0U8YmiYTyp5vNlmLRxiwGD8-4am8nBvdWYY1d-I,182704
26
26
  nexaai/binds/cpu_gpu/libggml-base.dylib,sha256=9urbatWTB4QJ6uariOYlB_ZN1FFci5GaD8OfGZ9oPSQ,650736
@@ -559,15 +559,15 @@ nexaai/tts_impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
559
559
  nexaai/tts_impl/mlx_tts_impl.py,sha256=i_uNPdvlXYtL3e01oKjDlP9jgkWCRt1bBHsExaaiJi8,3101
560
560
  nexaai/tts_impl/pybind_tts_impl.py,sha256=mpn44r6pfYLIl-NrEy2dXHjGtWtNCmM7HRyxiANxUI4,1444
561
561
  nexaai/utils/decode.py,sha256=61n4Zf6c5QLyqGoctEitlI9BX3tPlP2a5aaKNHbw3T4,404
562
- nexaai/utils/manifest_utils.py,sha256=SCcFN09xNI0DiTA1U7DZwWiQsRH0CInWSny_9q0BwNM,21273
563
- nexaai/utils/model_manager.py,sha256=NnbPv1iuwo6T523gLsWjnff-gGvPGUjez-rFg8-ffpE,59568
562
+ nexaai/utils/manifest_utils.py,sha256=OOp_BmFWH1ZHMYkS2VGAby5Rpm4f4GLCRBJEBYm-kys,21489
563
+ nexaai/utils/model_manager.py,sha256=CsRflxY329DgDeZxl_PGFKis7MQW7XROkrvZUCPEpvo,62022
564
564
  nexaai/utils/model_types.py,sha256=ONWjjo8CFPdhxki6qo7MXnSZaEzjBcxa_Kkf_y5NXus,1483
565
565
  nexaai/utils/progress_tracker.py,sha256=jdUqtmPqyhwC9uSKvQcJEYETwSt-OhP4oitdJ94614o,15394
566
566
  nexaai/utils/quantization_utils.py,sha256=FYcNSAKGlBqFDUTx3jSKOr2lnq4nyiyC0ZG8oSxFwiU,7825
567
567
  nexaai/vlm_impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
568
568
  nexaai/vlm_impl/mlx_vlm_impl.py,sha256=sgHqnX5OCSGLccCnTuRiktIbqThNn3AAIvYE2_Dy4TI,10833
569
569
  nexaai/vlm_impl/pybind_vlm_impl.py,sha256=MDbreWSqugakXU_PqH6mPoCxjKEEbYfQIco_NDck8_s,9905
570
- nexaai-1.0.21rc1.dist-info/METADATA,sha256=I2YizqGmn9LBQh1tfAPNxPZYE_limQe4ELxBlzYqtKM,1209
571
- nexaai-1.0.21rc1.dist-info/WHEEL,sha256=T2p57lol9__xkoU6aJTyN1Pm43ZpRU3q6km7mIbrAMs,114
572
- nexaai-1.0.21rc1.dist-info/top_level.txt,sha256=LRE2YERlrZk2vfuygnSzsEeqSknnZbz3Z1MHyNmBU4w,7
573
- nexaai-1.0.21rc1.dist-info/RECORD,,
570
+ nexaai-1.0.21rc2.dist-info/METADATA,sha256=hkj3IE2vIhQaOsChkXdv2vG7c3kKvn6bg74LkPLq4yY,1209
571
+ nexaai-1.0.21rc2.dist-info/WHEEL,sha256=T2p57lol9__xkoU6aJTyN1Pm43ZpRU3q6km7mIbrAMs,114
572
+ nexaai-1.0.21rc2.dist-info/top_level.txt,sha256=LRE2YERlrZk2vfuygnSzsEeqSknnZbz3Z1MHyNmBU4w,7
573
+ nexaai-1.0.21rc2.dist-info/RECORD,,