bigdl-core-cpp 2.5.0rc1__py3-none-win_amd64.whl → 2.6.0b20240827__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.
- bigdl/cpp/{convert-hf-to-gguf.py → convert_hf_to_gguf.py} +413 -67
- bigdl/cpp/convert_hf_to_gguf_update.py +354 -0
- bigdl/cpp/convert_llama_ggml_to_gguf.py +454 -0
- bigdl/cpp/convert_lora_to_gguf.py +393 -0
- bigdl/cpp/gguf-py/gguf/__init__.py +1 -1
- bigdl/cpp/gguf-py/gguf/constants.py +71 -2
- bigdl/cpp/gguf-py/gguf/gguf_writer.py +16 -1
- bigdl/cpp/gguf-py/gguf/lazy.py +4 -1
- bigdl/cpp/gguf-py/gguf/metadata.py +70 -63
- bigdl/cpp/gguf-py/gguf/quants.py +1129 -64
- bigdl/cpp/gguf-py/gguf/tensor_mapping.py +23 -15
- bigdl/cpp/gguf-py/gguf/utility.py +1 -1
- bigdl/cpp/gguf-py/gguf/vocab.py +301 -1
- bigdl/cpp/libs/common.lib +0 -0
- bigdl/cpp/libs/{gguf.exe → dist/windows-amd64/lib/ollama/runners/cpu/ggml.dll} +0 -0
- bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu/llama.dll +0 -0
- bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu/ollama_llama_server.exe +0 -0
- bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx/ggml.dll +0 -0
- bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx/llama.dll +0 -0
- bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx/ollama_llama_server.exe +0 -0
- bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx2/ggml.dll +0 -0
- bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx2/llama.dll +0 -0
- bigdl/cpp/libs/dist/windows-amd64/lib/ollama/runners/cpu_avx2/ollama_llama_server.exe +0 -0
- bigdl/cpp/libs/{ggml_shared.dll → ggml.dll} +0 -0
- bigdl/cpp/libs/llama-batched.exe +0 -0
- bigdl/cpp/libs/llama-bench.exe +0 -0
- bigdl/cpp/libs/llama-cli.exe +0 -0
- bigdl/cpp/libs/llama-embedding.exe +0 -0
- bigdl/cpp/libs/llama-gguf.exe +0 -0
- bigdl/cpp/libs/llama-llava-cli.exe +0 -0
- bigdl/cpp/libs/llama-lookup.exe +0 -0
- bigdl/cpp/libs/{ls-sycl-device.exe → llama-ls-sycl-device.exe} +0 -0
- bigdl/cpp/libs/llama-minicpmv-cli.exe +0 -0
- bigdl/cpp/libs/llama-perplexity.exe +0 -0
- bigdl/cpp/libs/llama-quantize.exe +0 -0
- bigdl/cpp/libs/llama-server.exe +0 -0
- bigdl/cpp/libs/llama-simple.exe +0 -0
- bigdl/cpp/libs/llama-speculative.exe +0 -0
- bigdl/cpp/libs/llama-tokenize.exe +0 -0
- bigdl/cpp/libs/llama.dll +0 -0
- bigdl/cpp/libs/llava_shared.dll +0 -0
- bigdl/cpp/libs/ollama.exe +0 -0
- {bigdl_core_cpp-2.5.0rc1.data → bigdl_core_cpp-2.6.0b20240827.data}/scripts/init-llama-cpp.bat +7 -2
- {bigdl_core_cpp-2.5.0rc1.data → bigdl_core_cpp-2.6.0b20240827.data}/scripts/init-ollama.bat +6 -0
- {bigdl_core_cpp-2.5.0rc1.dist-info → bigdl_core_cpp-2.6.0b20240827.dist-info}/METADATA +1 -1
- bigdl_core_cpp-2.6.0b20240827.dist-info/RECORD +54 -0
- bigdl/cpp/convert.py +0 -1714
- bigdl/cpp/libs/baby-llama.exe +0 -0
- bigdl/cpp/libs/batched-bench.exe +0 -0
- bigdl/cpp/libs/batched.exe +0 -0
- bigdl/cpp/libs/beam-search.exe +0 -0
- bigdl/cpp/libs/benchmark.exe +0 -0
- bigdl/cpp/libs/convert-llama2c-to-ggml.exe +0 -0
- bigdl/cpp/libs/dist/windows-amd64/ollama_runners/cpu/ollama_llama_server.exe +0 -0
- bigdl/cpp/libs/dist/windows-amd64/ollama_runners/cpu_avx/ollama_llama_server.exe +0 -0
- bigdl/cpp/libs/dist/windows-amd64/ollama_runners/cpu_avx2/ollama_llama_server.exe +0 -0
- bigdl/cpp/libs/embedding.exe +0 -0
- bigdl/cpp/libs/export-lora.exe +0 -0
- bigdl/cpp/libs/finetune.exe +0 -0
- bigdl/cpp/libs/gritlm.exe +0 -0
- bigdl/cpp/libs/imatrix.exe +0 -0
- bigdl/cpp/libs/infill.exe +0 -0
- bigdl/cpp/libs/llava-cli.exe +0 -0
- bigdl/cpp/libs/lookahead.exe +0 -0
- bigdl/cpp/libs/lookup.exe +0 -0
- bigdl/cpp/libs/main.exe +0 -0
- bigdl/cpp/libs/parallel.exe +0 -0
- bigdl/cpp/libs/passkey.exe +0 -0
- bigdl/cpp/libs/perplexity.exe +0 -0
- bigdl/cpp/libs/q8dot.exe +0 -0
- bigdl/cpp/libs/quantize-stats.exe +0 -0
- bigdl/cpp/libs/quantize.exe +0 -0
- bigdl/cpp/libs/save-load-state.exe +0 -0
- bigdl/cpp/libs/server.exe +0 -0
- bigdl/cpp/libs/simple.exe +0 -0
- bigdl/cpp/libs/speculative.exe +0 -0
- bigdl/cpp/libs/tokenize.exe +0 -0
- bigdl/cpp/libs/train-text-from-scratch.exe +0 -0
- bigdl/cpp/libs/vdot.exe +0 -0
- bigdl_core_cpp-2.5.0rc1.dist-info/RECORD +0 -63
- {bigdl_core_cpp-2.5.0rc1.data → bigdl_core_cpp-2.6.0b20240827.data}/scripts/init-llama-cpp.ps1 +0 -0
- {bigdl_core_cpp-2.5.0rc1.dist-info → bigdl_core_cpp-2.6.0b20240827.dist-info}/WHEEL +0 -0
- {bigdl_core_cpp-2.5.0rc1.dist-info → bigdl_core_cpp-2.6.0b20240827.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
|
-
|
288
|
-
|
289
|
-
|
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
|
-
|
293
|
-
#
|
294
|
-
|
295
|
-
|
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
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
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
|
-
|
333
|
-
|
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
|
-
|
375
|
-
|
383
|
+
use_array_model_card_metadata("tags", "tags")
|
384
|
+
use_array_model_card_metadata("tags", "pipeline_tag")
|
376
385
|
|
377
|
-
|
378
|
-
|
386
|
+
use_array_model_card_metadata("languages", "languages")
|
387
|
+
use_array_model_card_metadata("languages", "language")
|
379
388
|
|
380
|
-
|
381
|
-
|
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)
|