bigdl-core-cpp 2.5.0rc1__py3-none-win_amd64.whl → 2.6.0b2__py3-none-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.
Files changed (85) hide show
  1. bigdl/cpp/{convert-hf-to-gguf.py → convert_hf_to_gguf.py} +413 -67
  2. bigdl/cpp/convert_hf_to_gguf_update.py +354 -0
  3. bigdl/cpp/convert_llama_ggml_to_gguf.py +454 -0
  4. bigdl/cpp/convert_lora_to_gguf.py +393 -0
  5. bigdl/cpp/gguf-py/gguf/__init__.py +1 -1
  6. bigdl/cpp/gguf-py/gguf/constants.py +71 -2
  7. bigdl/cpp/gguf-py/gguf/gguf_writer.py +16 -1
  8. bigdl/cpp/gguf-py/gguf/lazy.py +4 -1
  9. bigdl/cpp/gguf-py/gguf/metadata.py +70 -63
  10. bigdl/cpp/gguf-py/gguf/quants.py +1129 -64
  11. bigdl/cpp/gguf-py/gguf/tensor_mapping.py +23 -15
  12. bigdl/cpp/gguf-py/gguf/utility.py +1 -1
  13. bigdl/cpp/gguf-py/gguf/vocab.py +301 -1
  14. bigdl/cpp/libs/common.lib +0 -0
  15. bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu/ggml.dll +0 -0
  16. bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu/llama.dll +0 -0
  17. bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu/ollama_llama_server.exe +0 -0
  18. bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx/ggml.dll +0 -0
  19. bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx/llama.dll +0 -0
  20. bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx/ollama_llama_server.exe +0 -0
  21. bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx2/ggml.dll +0 -0
  22. bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx2/llama.dll +0 -0
  23. bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx2/ollama_llama_server.exe +0 -0
  24. bigdl/cpp/libs/ggml.dll +0 -0
  25. bigdl/cpp/libs/llama-batched.exe +0 -0
  26. bigdl/cpp/libs/llama-bench.exe +0 -0
  27. bigdl/cpp/libs/llama-cli.exe +0 -0
  28. bigdl/cpp/libs/llama-embedding.exe +0 -0
  29. bigdl/cpp/libs/llama-gguf.exe +0 -0
  30. bigdl/cpp/libs/llama-llava-cli.exe +0 -0
  31. bigdl/cpp/libs/llama-lookup.exe +0 -0
  32. bigdl/cpp/libs/{ls-sycl-device.exe → llama-ls-sycl-device.exe} +0 -0
  33. bigdl/cpp/libs/llama-minicpmv-cli.exe +0 -0
  34. bigdl/cpp/libs/llama-perplexity.exe +0 -0
  35. bigdl/cpp/libs/llama-quantize.exe +0 -0
  36. bigdl/cpp/libs/llama-server.exe +0 -0
  37. bigdl/cpp/libs/llama-simple.exe +0 -0
  38. bigdl/cpp/libs/llama-speculative.exe +0 -0
  39. bigdl/cpp/libs/llama-tokenize.exe +0 -0
  40. bigdl/cpp/libs/llama.dll +0 -0
  41. bigdl/cpp/libs/llava_shared.dll +0 -0
  42. bigdl/cpp/libs/ollama.exe +0 -0
  43. {bigdl_core_cpp-2.5.0rc1.data → bigdl_core_cpp-2.6.0b2.data}/scripts/init-llama-cpp.bat +7 -2
  44. {bigdl_core_cpp-2.5.0rc1.data → bigdl_core_cpp-2.6.0b2.data}/scripts/init-ollama.bat +6 -0
  45. {bigdl_core_cpp-2.5.0rc1.dist-info → bigdl_core_cpp-2.6.0b2.dist-info}/METADATA +3 -3
  46. bigdl_core_cpp-2.6.0b2.dist-info/RECORD +54 -0
  47. {bigdl_core_cpp-2.5.0rc1.dist-info → bigdl_core_cpp-2.6.0b2.dist-info}/WHEEL +1 -1
  48. bigdl/cpp/convert.py +0 -1714
  49. bigdl/cpp/libs/baby-llama.exe +0 -0
  50. bigdl/cpp/libs/batched-bench.exe +0 -0
  51. bigdl/cpp/libs/batched.exe +0 -0
  52. bigdl/cpp/libs/beam-search.exe +0 -0
  53. bigdl/cpp/libs/benchmark.exe +0 -0
  54. bigdl/cpp/libs/convert-llama2c-to-ggml.exe +0 -0
  55. bigdl/cpp/libs/dist/windows-amd64/ollama_runners/cpu/ollama_llama_server.exe +0 -0
  56. bigdl/cpp/libs/dist/windows-amd64/ollama_runners/cpu_avx/ollama_llama_server.exe +0 -0
  57. bigdl/cpp/libs/dist/windows-amd64/ollama_runners/cpu_avx2/ollama_llama_server.exe +0 -0
  58. bigdl/cpp/libs/embedding.exe +0 -0
  59. bigdl/cpp/libs/export-lora.exe +0 -0
  60. bigdl/cpp/libs/finetune.exe +0 -0
  61. bigdl/cpp/libs/ggml_shared.dll +0 -0
  62. bigdl/cpp/libs/gguf.exe +0 -0
  63. bigdl/cpp/libs/gritlm.exe +0 -0
  64. bigdl/cpp/libs/imatrix.exe +0 -0
  65. bigdl/cpp/libs/infill.exe +0 -0
  66. bigdl/cpp/libs/llava-cli.exe +0 -0
  67. bigdl/cpp/libs/lookahead.exe +0 -0
  68. bigdl/cpp/libs/lookup.exe +0 -0
  69. bigdl/cpp/libs/main.exe +0 -0
  70. bigdl/cpp/libs/parallel.exe +0 -0
  71. bigdl/cpp/libs/passkey.exe +0 -0
  72. bigdl/cpp/libs/perplexity.exe +0 -0
  73. bigdl/cpp/libs/q8dot.exe +0 -0
  74. bigdl/cpp/libs/quantize-stats.exe +0 -0
  75. bigdl/cpp/libs/quantize.exe +0 -0
  76. bigdl/cpp/libs/save-load-state.exe +0 -0
  77. bigdl/cpp/libs/server.exe +0 -0
  78. bigdl/cpp/libs/simple.exe +0 -0
  79. bigdl/cpp/libs/speculative.exe +0 -0
  80. bigdl/cpp/libs/tokenize.exe +0 -0
  81. bigdl/cpp/libs/train-text-from-scratch.exe +0 -0
  82. bigdl/cpp/libs/vdot.exe +0 -0
  83. bigdl_core_cpp-2.5.0rc1.dist-info/RECORD +0 -63
  84. {bigdl_core_cpp-2.5.0rc1.data → bigdl_core_cpp-2.6.0b2.data}/scripts/init-llama-cpp.ps1 +0 -0
  85. {bigdl_core_cpp-2.5.0rc1.dist-info → bigdl_core_cpp-2.6.0b2.dist-info}/top_level.txt +0 -0
@@ -174,7 +174,7 @@ class Metadata:
174
174
  org_component, model_full_name_component = None, model_id
175
175
 
176
176
  # Check if we erroneously matched against './' or '../' etc...
177
- if org_component is not None and org_component[0] == '.':
177
+ if org_component is not None and len(org_component) > 0 and org_component[0] == '.':
178
178
  org_component = None
179
179
 
180
180
  name_parts: list[str] = model_full_name_component.split('-')
@@ -284,20 +284,67 @@ class Metadata:
284
284
  ########################
285
285
  if model_card is not None:
286
286
 
287
- if "model_name" in model_card and metadata.name is None:
288
- # Not part of huggingface model card standard but notice some model creator using it
289
- # such as TheBloke in 'TheBloke/Mistral-7B-Instruct-v0.2-GGUF'
290
- metadata.name = model_card.get("model_name")
287
+ def use_model_card_metadata(metadata_key: str, model_card_key: str):
288
+ if model_card_key in model_card and getattr(metadata, metadata_key, None) is None:
289
+ setattr(metadata, metadata_key, model_card.get(model_card_key))
291
290
 
292
- if "model_creator" in model_card and metadata.author is None:
293
- # Not part of huggingface model card standard but notice some model creator using it
294
- # such as TheBloke in 'TheBloke/Mistral-7B-Instruct-v0.2-GGUF'
295
- metadata.author = model_card.get("model_creator")
291
+ def use_array_model_card_metadata(metadata_key: str, model_card_key: str):
292
+ # Note: Will append rather than replace if already exist
293
+ tags_value = model_card.get(model_card_key, None)
294
+ if tags_value is None:
295
+ return
296
296
 
297
- if "model_type" in model_card and metadata.basename is None:
298
- # Not part of huggingface model card standard but notice some model creator using it
299
- # such as TheBloke in 'TheBloke/Mistral-7B-Instruct-v0.2-GGUF'
300
- metadata.basename = model_card.get("model_type")
297
+ current_value = getattr(metadata, metadata_key, None)
298
+ if current_value is None:
299
+ current_value = []
300
+
301
+ if isinstance(tags_value, str):
302
+ current_value.append(tags_value)
303
+ elif isinstance(tags_value, list):
304
+ current_value.extend(tags_value)
305
+
306
+ setattr(metadata, metadata_key, current_value)
307
+
308
+ # LLAMA.cpp's direct internal convention
309
+ # (Definitely not part of hugging face formal/informal standard)
310
+ #########################################
311
+ use_model_card_metadata("name", "name")
312
+ use_model_card_metadata("author", "author")
313
+ use_model_card_metadata("version", "version")
314
+ use_model_card_metadata("organization", "organization")
315
+ use_model_card_metadata("description", "description")
316
+ use_model_card_metadata("finetune", "finetune")
317
+ use_model_card_metadata("basename", "basename")
318
+ use_model_card_metadata("size_label", "size_label")
319
+ use_model_card_metadata("source_url", "url")
320
+ use_model_card_metadata("source_doi", "doi")
321
+ use_model_card_metadata("source_uuid", "uuid")
322
+ use_model_card_metadata("source_repo_url", "repo_url")
323
+
324
+ # LLAMA.cpp's huggingface style convention
325
+ # (Definitely not part of hugging face formal/informal standard... but with model_ appended to match their style)
326
+ ###########################################
327
+ use_model_card_metadata("name", "model_name")
328
+ use_model_card_metadata("author", "model_author")
329
+ use_model_card_metadata("version", "model_version")
330
+ use_model_card_metadata("organization", "model_organization")
331
+ use_model_card_metadata("description", "model_description")
332
+ use_model_card_metadata("finetune", "model_finetune")
333
+ use_model_card_metadata("basename", "model_basename")
334
+ use_model_card_metadata("size_label", "model_size_label")
335
+ use_model_card_metadata("source_url", "model_url")
336
+ use_model_card_metadata("source_doi", "model_doi")
337
+ use_model_card_metadata("source_uuid", "model_uuid")
338
+ use_model_card_metadata("source_repo_url", "model_repo_url")
339
+
340
+ # Hugging Face Direct Convention
341
+ #################################
342
+
343
+ # Not part of huggingface model card standard but notice some model creator using it
344
+ # such as TheBloke in 'TheBloke/Mistral-7B-Instruct-v0.2-GGUF'
345
+ use_model_card_metadata("name", "model_name")
346
+ use_model_card_metadata("author", "model_creator")
347
+ use_model_card_metadata("basename", "model_type")
301
348
 
302
349
  if "base_model" in model_card:
303
350
  # This represents the parent models that this is based on
@@ -329,58 +376,18 @@ class Metadata:
329
376
  base_model["repo_url"] = f"https://huggingface.co/{org_component}/{model_full_name_component}"
330
377
  metadata.base_models.append(base_model)
331
378
 
332
- if "license" in model_card and metadata.license is None:
333
- metadata.license = model_card.get("license")
334
-
335
- if "license_name" in model_card and metadata.license_name is None:
336
- metadata.license_name = model_card.get("license_name")
337
-
338
- if "license_link" in model_card and metadata.license_link is None:
339
- metadata.license_link = model_card.get("license_link")
340
-
341
- tags_value = model_card.get("tags", None)
342
- if tags_value is not None:
343
-
344
- if metadata.tags is None:
345
- metadata.tags = []
346
-
347
- if isinstance(tags_value, str):
348
- metadata.tags.append(tags_value)
349
- elif isinstance(tags_value, list):
350
- metadata.tags.extend(tags_value)
351
-
352
- pipeline_tags_value = model_card.get("pipeline_tag", None)
353
- if pipeline_tags_value is not None:
354
-
355
- if metadata.tags is None:
356
- metadata.tags = []
357
-
358
- if isinstance(pipeline_tags_value, str):
359
- metadata.tags.append(pipeline_tags_value)
360
- elif isinstance(pipeline_tags_value, list):
361
- metadata.tags.extend(pipeline_tags_value)
362
-
363
- language_value = model_card.get("languages", model_card.get("language", None))
364
- if language_value is not None:
365
-
366
- if metadata.languages is None:
367
- metadata.languages = []
368
-
369
- if isinstance(language_value, str):
370
- metadata.languages.append(language_value)
371
- elif isinstance(language_value, list):
372
- metadata.languages.extend(language_value)
379
+ use_model_card_metadata("license", "license")
380
+ use_model_card_metadata("license_name", "license_name")
381
+ use_model_card_metadata("license_link", "license_link")
373
382
 
374
- dataset_value = model_card.get("datasets", model_card.get("dataset", None))
375
- if dataset_value is not None:
383
+ use_array_model_card_metadata("tags", "tags")
384
+ use_array_model_card_metadata("tags", "pipeline_tag")
376
385
 
377
- if metadata.datasets is None:
378
- metadata.datasets = []
386
+ use_array_model_card_metadata("languages", "languages")
387
+ use_array_model_card_metadata("languages", "language")
379
388
 
380
- if isinstance(dataset_value, str):
381
- metadata.datasets.append(dataset_value)
382
- elif isinstance(dataset_value, list):
383
- metadata.datasets.extend(dataset_value)
389
+ use_array_model_card_metadata("datasets", "datasets")
390
+ use_array_model_card_metadata("datasets", "dataset")
384
391
 
385
392
  # Hugging Face Parameter Heuristics
386
393
  ####################################
@@ -500,4 +507,4 @@ class Metadata:
500
507
  if self.languages is not None:
501
508
  gguf_writer.add_languages(self.languages)
502
509
  if self.datasets is not None:
503
- gguf_writer.add_datasets(self.datasets)
510
+ gguf_writer.add_datasets(self.datasets)