bigdl-core-cpp 2.1.0b20240820.post1__py3-none-win_amd64.whl → 2.2.0b20250217.post0__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 (91) hide show
  1. bigdl/cpp/{convert-hf-to-gguf.py → convert_hf_to_gguf.py} +908 -140
  2. bigdl/cpp/convert_hf_to_gguf_update.py +376 -0
  3. bigdl/cpp/convert_llama_ggml_to_gguf.py +450 -0
  4. bigdl/cpp/convert_lora_to_gguf.py +433 -0
  5. bigdl/cpp/gguf-py/gguf/__init__.py +1 -1
  6. bigdl/cpp/gguf-py/gguf/constants.py +414 -89
  7. bigdl/cpp/gguf-py/gguf/gguf.py +1 -1
  8. bigdl/cpp/gguf-py/gguf/gguf_reader.py +5 -6
  9. bigdl/cpp/gguf-py/gguf/gguf_writer.py +77 -14
  10. bigdl/cpp/gguf-py/gguf/lazy.py +3 -1
  11. bigdl/cpp/gguf-py/gguf/metadata.py +195 -76
  12. bigdl/cpp/gguf-py/gguf/quants.py +1210 -64
  13. bigdl/cpp/gguf-py/gguf/tensor_mapping.py +156 -34
  14. bigdl/cpp/gguf-py/gguf/utility.py +1 -1
  15. bigdl/cpp/gguf-py/gguf/vocab.py +325 -3
  16. bigdl/cpp/libs/common.lib +0 -0
  17. bigdl/cpp/libs/ggml-base.dll +0 -0
  18. bigdl/cpp/libs/ggml-cpu.dll +0 -0
  19. bigdl/cpp/libs/ggml-sycl.dll +0 -0
  20. bigdl/cpp/libs/ggml.dll +0 -0
  21. bigdl/cpp/libs/libc++.dll +0 -0
  22. bigdl/cpp/libs/llama-batched.exe +0 -0
  23. bigdl/cpp/libs/llama-bench.exe +0 -0
  24. bigdl/cpp/libs/llama-cli.exe +0 -0
  25. bigdl/cpp/libs/llama-embedding.exe +0 -0
  26. bigdl/cpp/libs/llama-gguf.exe +0 -0
  27. bigdl/cpp/libs/llama-llava-cli.exe +0 -0
  28. bigdl/cpp/libs/llama-lookup.exe +0 -0
  29. bigdl/cpp/libs/llama-ls-sycl-device.exe +0 -0
  30. bigdl/cpp/libs/llama-minicpmv-cli.exe +0 -0
  31. bigdl/cpp/libs/llama-perplexity.exe +0 -0
  32. bigdl/cpp/libs/llama-quantize.exe +0 -0
  33. bigdl/cpp/libs/llama-server.exe +0 -0
  34. bigdl/cpp/libs/llama-simple.exe +0 -0
  35. bigdl/cpp/libs/llama-speculative.exe +0 -0
  36. bigdl/cpp/libs/llama-tokenize.exe +0 -0
  37. bigdl/cpp/libs/llama.dll +0 -0
  38. bigdl/cpp/libs/llava_shared.dll +0 -0
  39. bigdl/cpp/libs/ollama-ggml-base.dll +0 -0
  40. bigdl/cpp/libs/ollama-ggml-cpu.dll +0 -0
  41. bigdl/cpp/libs/ollama-ggml-sycl.dll +0 -0
  42. bigdl/cpp/libs/ollama-lib.exe +0 -0
  43. bigdl/cpp/libs/ollama.exe +0 -0
  44. bigdl/cpp/libs/ollama_ggml.dll +0 -0
  45. bigdl/cpp/libs/ollama_llama.dll +0 -0
  46. bigdl/cpp/libs/ollama_llava_shared.dll +0 -0
  47. {bigdl_core_cpp-2.1.0b20240820.post1.data → bigdl_core_cpp-2.2.0b20250217.post0.data}/scripts/init-llama-cpp.bat +7 -2
  48. bigdl_core_cpp-2.2.0b20250217.post0.data/scripts/init-ollama.bat +16 -0
  49. {bigdl_core_cpp-2.1.0b20240820.post1.dist-info → bigdl_core_cpp-2.2.0b20250217.post0.dist-info}/METADATA +9 -5
  50. bigdl_core_cpp-2.2.0b20250217.post0.dist-info/RECORD +56 -0
  51. {bigdl_core_cpp-2.1.0b20240820.post1.dist-info → bigdl_core_cpp-2.2.0b20250217.post0.dist-info}/WHEEL +1 -1
  52. bigdl/cpp/convert.py +0 -1714
  53. bigdl/cpp/libs/baby-llama.exe +0 -0
  54. bigdl/cpp/libs/batched-bench.exe +0 -0
  55. bigdl/cpp/libs/batched.exe +0 -0
  56. bigdl/cpp/libs/beam-search.exe +0 -0
  57. bigdl/cpp/libs/benchmark.exe +0 -0
  58. bigdl/cpp/libs/convert-llama2c-to-ggml.exe +0 -0
  59. bigdl/cpp/libs/dist/windows-amd64/ollama_runners/cpu/ollama_llama_server.exe +0 -0
  60. bigdl/cpp/libs/dist/windows-amd64/ollama_runners/cpu_avx/ollama_llama_server.exe +0 -0
  61. bigdl/cpp/libs/dist/windows-amd64/ollama_runners/cpu_avx2/ollama_llama_server.exe +0 -0
  62. bigdl/cpp/libs/embedding.exe +0 -0
  63. bigdl/cpp/libs/export-lora.exe +0 -0
  64. bigdl/cpp/libs/finetune.exe +0 -0
  65. bigdl/cpp/libs/ggml_shared.dll +0 -0
  66. bigdl/cpp/libs/gguf.exe +0 -0
  67. bigdl/cpp/libs/gritlm.exe +0 -0
  68. bigdl/cpp/libs/imatrix.exe +0 -0
  69. bigdl/cpp/libs/infill.exe +0 -0
  70. bigdl/cpp/libs/llava-cli.exe +0 -0
  71. bigdl/cpp/libs/lookahead.exe +0 -0
  72. bigdl/cpp/libs/lookup.exe +0 -0
  73. bigdl/cpp/libs/ls-sycl-device.exe +0 -0
  74. bigdl/cpp/libs/main.exe +0 -0
  75. bigdl/cpp/libs/parallel.exe +0 -0
  76. bigdl/cpp/libs/passkey.exe +0 -0
  77. bigdl/cpp/libs/perplexity.exe +0 -0
  78. bigdl/cpp/libs/q8dot.exe +0 -0
  79. bigdl/cpp/libs/quantize-stats.exe +0 -0
  80. bigdl/cpp/libs/quantize.exe +0 -0
  81. bigdl/cpp/libs/save-load-state.exe +0 -0
  82. bigdl/cpp/libs/server.exe +0 -0
  83. bigdl/cpp/libs/simple.exe +0 -0
  84. bigdl/cpp/libs/speculative.exe +0 -0
  85. bigdl/cpp/libs/tokenize.exe +0 -0
  86. bigdl/cpp/libs/train-text-from-scratch.exe +0 -0
  87. bigdl/cpp/libs/vdot.exe +0 -0
  88. bigdl_core_cpp-2.1.0b20240820.post1.data/scripts/init-ollama.bat +0 -13
  89. bigdl_core_cpp-2.1.0b20240820.post1.dist-info/RECORD +0 -63
  90. {bigdl_core_cpp-2.1.0b20240820.post1.data → bigdl_core_cpp-2.2.0b20250217.post0.data}/scripts/init-llama-cpp.ps1 +0 -0
  91. {bigdl_core_cpp-2.1.0b20240820.post1.dist-info → bigdl_core_cpp-2.2.0b20250217.post0.dist-info}/top_level.txt +0 -0
@@ -1,10 +1,15 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import re
3
4
  import logging
4
5
  import json
5
6
  import os
6
7
  from pathlib import Path
7
- from typing import Any, Callable, Sequence, Mapping, Iterable
8
+ from typing import Any, Callable, Sequence, Mapping, Iterable, Protocol, ClassVar, runtime_checkable
9
+
10
+ from sentencepiece import SentencePieceProcessor
11
+
12
+ import gguf
8
13
 
9
14
  from .gguf_writer import GGUFWriter
10
15
 
@@ -117,8 +122,30 @@ class SpecialVocab:
117
122
  tokenizer = json.load(f)
118
123
  if self.load_merges:
119
124
  merges = tokenizer.get('model', {}).get('merges')
120
- if isinstance(merges, list) and merges and isinstance(merges[0], str):
121
- self.merges = merges
125
+ if isinstance(merges, list) and merges:
126
+ if isinstance(merges[0], str):
127
+ self.merges = merges
128
+ elif isinstance(merges[0], list) and len(merges[0]) == 2 and isinstance(merges[0][0], str):
129
+ # New format since transformers 4.45 to support spaces in merges
130
+ # ref: https://github.com/ggerganov/llama.cpp/issues/9692
131
+ # TODO: internally store as the new format instead of converting to old
132
+ if any(' ' in s for pair in merges for s in pair):
133
+ logger.warning(f'Spaces in merges detected, encoding as {chr(ord(" ") + 256)!r}')
134
+ self.merges = [
135
+ ' '.join(
136
+ [
137
+ # ensure the spaces are properly encoded
138
+ ''.join(
139
+ chr(ord(c) + 256) if c == ' ' else c
140
+ for c in part
141
+ )
142
+ for part in pair
143
+ ]
144
+ )
145
+ for pair in merges
146
+ ]
147
+ else:
148
+ raise ValueError("Unknown tokenizer merges format")
122
149
  added_tokens = tokenizer.get('added_tokens', {})
123
150
  else:
124
151
  added_tokens = {}
@@ -163,3 +190,298 @@ class SpecialVocab:
163
190
  for typ in self.special_token_types:
164
191
  self._set_special_token(typ, config.get(f'{typ}_token_id'))
165
192
  return True
193
+
194
+
195
+ @runtime_checkable
196
+ class BaseVocab(Protocol):
197
+ tokenizer_model: ClassVar[str]
198
+ name: ClassVar[str]
199
+
200
+
201
+ @runtime_checkable
202
+ class Vocab(BaseVocab, Protocol):
203
+ vocab_size: int
204
+ added_tokens_dict: dict[str, int]
205
+ added_tokens_list: list[str]
206
+ fname_tokenizer: Path
207
+
208
+ def __init__(self, base_path: Path): ...
209
+ def all_tokens(self) -> Iterable[tuple[bytes, float, gguf.TokenType]]: ...
210
+
211
+
212
+ class NoVocab(BaseVocab):
213
+ tokenizer_model = "no_vocab"
214
+ name = "no_vocab"
215
+
216
+ def __repr__(self) -> str:
217
+ return "<NoVocab for a model without integrated vocabulary>"
218
+
219
+
220
+ class BpeVocab(Vocab):
221
+ tokenizer_model = "gpt2"
222
+ name = "bpe"
223
+
224
+ def __init__(self, base_path: Path):
225
+ added_tokens: dict[str, int] = {}
226
+
227
+ if (fname_tokenizer := base_path / 'vocab.json').exists():
228
+ # "slow" tokenizer
229
+ with open(fname_tokenizer, encoding="utf-8") as f:
230
+ self.vocab = json.load(f)
231
+
232
+ try:
233
+ # FIXME: Verify that added tokens here _cannot_ overlap with the main vocab.
234
+ with open(base_path / 'added_tokens.json', encoding="utf-8") as f:
235
+ added_tokens = json.load(f)
236
+ except FileNotFoundError:
237
+ pass
238
+ else:
239
+ # "fast" tokenizer
240
+ fname_tokenizer = base_path / 'tokenizer.json'
241
+
242
+ # if this fails, FileNotFoundError propagates to caller
243
+ with open(fname_tokenizer, encoding="utf-8") as f:
244
+ tokenizer_json = json.load(f)
245
+
246
+ tokenizer_model: dict[str, Any] = tokenizer_json['model']
247
+ if (
248
+ tokenizer_model['type'] != 'BPE' or tokenizer_model.get('byte_fallback', False)
249
+ or tokenizer_json['decoder']['type'] != 'ByteLevel'
250
+ ):
251
+ raise FileNotFoundError('Cannot find GPT-2 BPE tokenizer')
252
+
253
+ self.vocab = tokenizer_model["vocab"]
254
+
255
+ if (added := tokenizer_json.get('added_tokens')) is not None:
256
+ # Added tokens here can be duplicates of the main vocabulary.
257
+ added_tokens = {item['content']: item['id']
258
+ for item in added
259
+ if item['content'] not in self.vocab}
260
+
261
+ vocab_size = len(self.vocab)
262
+ expected_ids = list(range(vocab_size, vocab_size + len(added_tokens)))
263
+ actual_ids = sorted(added_tokens.values())
264
+ if expected_ids != actual_ids:
265
+ expected_end_id = vocab_size + len(actual_ids) - 1
266
+ raise ValueError(f"Expected the {len(actual_ids)} added token ID(s) to be sequential in the range "
267
+ f"{vocab_size} - {expected_end_id}; got {actual_ids}")
268
+
269
+ items = sorted(added_tokens.items(), key=lambda text_idx: text_idx[1])
270
+ self.added_tokens_dict = added_tokens
271
+ self.added_tokens_list = [text for (text, idx) in items]
272
+ self.vocab_size_base = vocab_size
273
+ self.vocab_size = self.vocab_size_base + len(self.added_tokens_list)
274
+ self.fname_tokenizer = fname_tokenizer
275
+
276
+ def bpe_tokens(self) -> Iterable[tuple[bytes, float, gguf.TokenType]]:
277
+ reverse_vocab = {id: encoded_tok for encoded_tok, id in self.vocab.items()}
278
+
279
+ for i, _ in enumerate(self.vocab):
280
+ yield reverse_vocab[i], 0.0, gguf.TokenType.NORMAL
281
+
282
+ def added_tokens(self) -> Iterable[tuple[bytes, float, gguf.TokenType]]:
283
+ for text in self.added_tokens_list:
284
+ score = -1000.0
285
+ yield text.encode("utf-8"), score, gguf.TokenType.CONTROL
286
+
287
+ def all_tokens(self) -> Iterable[tuple[bytes, float, gguf.TokenType]]:
288
+ yield from self.bpe_tokens()
289
+ yield from self.added_tokens()
290
+
291
+ def __repr__(self) -> str:
292
+ return f"<BpeVocab with {self.vocab_size_base} base tokens and {len(self.added_tokens_list)} added tokens>"
293
+
294
+
295
+ class SentencePieceVocab(Vocab):
296
+ tokenizer_model = "llama"
297
+ name = "spm"
298
+
299
+ def __init__(self, base_path: Path):
300
+ added_tokens: dict[str, int] = {}
301
+ if (fname_tokenizer := base_path / 'tokenizer.model').exists():
302
+ # normal location
303
+ try:
304
+ with open(base_path / 'added_tokens.json', encoding="utf-8") as f:
305
+ added_tokens = json.load(f)
306
+ except FileNotFoundError:
307
+ pass
308
+ elif not (fname_tokenizer := base_path.parent / 'tokenizer.model').exists():
309
+ # not found in alternate location either
310
+ raise FileNotFoundError('Cannot find tokenizer.model')
311
+
312
+ self.sentencepiece_tokenizer = SentencePieceProcessor()
313
+ self.sentencepiece_tokenizer.LoadFromFile(str(fname_tokenizer))
314
+ vocab_size = self.sentencepiece_tokenizer.vocab_size()
315
+
316
+ new_tokens = {id: piece for piece, id in added_tokens.items() if id >= vocab_size}
317
+ expected_new_ids = list(range(vocab_size, vocab_size + len(new_tokens)))
318
+ actual_new_ids = sorted(new_tokens.keys())
319
+
320
+ if expected_new_ids != actual_new_ids:
321
+ raise ValueError(f"Expected new token IDs {expected_new_ids} to be sequential; got {actual_new_ids}")
322
+
323
+ # Token pieces that were added to the base vocabulary.
324
+ self.added_tokens_dict = added_tokens
325
+ self.added_tokens_list = [new_tokens[id] for id in actual_new_ids]
326
+ self.vocab_size_base = vocab_size
327
+ self.vocab_size = self.vocab_size_base + len(self.added_tokens_list)
328
+ self.fname_tokenizer = fname_tokenizer
329
+
330
+ def sentencepiece_tokens(self) -> Iterable[tuple[bytes, float, gguf.TokenType]]:
331
+ tokenizer = self.sentencepiece_tokenizer
332
+ for i in range(tokenizer.vocab_size()):
333
+ piece = tokenizer.IdToPiece(i)
334
+ text = piece.encode("utf-8")
335
+ score: float = tokenizer.GetScore(i)
336
+
337
+ toktype = gguf.TokenType.NORMAL
338
+ if tokenizer.IsUnknown(i):
339
+ toktype = gguf.TokenType.UNKNOWN
340
+ if tokenizer.IsControl(i):
341
+ toktype = gguf.TokenType.CONTROL
342
+
343
+ # NOTE: I think added_tokens are user defined.
344
+ # ref: https://github.com/google/sentencepiece/blob/master/src/sentencepiece_model.proto
345
+ # if tokenizer.is_user_defined(i): toktype = gguf.TokenType.USER_DEFINED
346
+
347
+ if tokenizer.IsUnused(i):
348
+ toktype = gguf.TokenType.UNUSED
349
+ if tokenizer.IsByte(i):
350
+ toktype = gguf.TokenType.BYTE
351
+
352
+ yield text, score, toktype
353
+
354
+ def added_tokens(self) -> Iterable[tuple[bytes, float, gguf.TokenType]]:
355
+ for text in self.added_tokens_list:
356
+ score = -1000.0
357
+ yield text.encode("utf-8"), score, gguf.TokenType.USER_DEFINED
358
+
359
+ def all_tokens(self) -> Iterable[tuple[bytes, float, gguf.TokenType]]:
360
+ yield from self.sentencepiece_tokens()
361
+ yield from self.added_tokens()
362
+
363
+ def __repr__(self) -> str:
364
+ return f"<SentencePieceVocab with {self.vocab_size_base} base tokens and {len(self.added_tokens_list)} added tokens>"
365
+
366
+
367
+ class LlamaHfVocab(Vocab):
368
+ tokenizer_model = "llama"
369
+ name = "hfft"
370
+
371
+ def __init__(self, base_path: Path):
372
+ fname_tokenizer = base_path / 'tokenizer.json'
373
+ # if this fails, FileNotFoundError propagates to caller
374
+ with open(fname_tokenizer, encoding='utf-8') as f:
375
+ tokenizer_json = json.load(f)
376
+
377
+ # pre-check so we know if we need transformers
378
+ tokenizer_model: dict[str, Any] = tokenizer_json['model']
379
+ is_llama3 = (
380
+ tokenizer_model['type'] == 'BPE' and tokenizer_model.get('ignore_merges', False)
381
+ and not tokenizer_model.get('byte_fallback', True)
382
+ )
383
+ if is_llama3:
384
+ raise TypeError('Llama 3 must be converted with BpeVocab')
385
+
386
+ if not is_llama3 and (
387
+ tokenizer_model['type'] != 'BPE' or not tokenizer_model.get('byte_fallback', False)
388
+ or tokenizer_json['decoder']['type'] != 'Sequence'
389
+ ):
390
+ raise FileNotFoundError('Cannot find Llama BPE tokenizer')
391
+
392
+ try:
393
+ from transformers import AutoTokenizer
394
+ except ImportError as e:
395
+ raise ImportError(
396
+ "To use LlamaHfVocab, please install the `transformers` package. "
397
+ "You can install it with `pip install transformers`."
398
+ ) from e
399
+
400
+ # Allow the tokenizer to default to slow or fast versions.
401
+ # Explicitly set tokenizer to use local paths.
402
+ self.tokenizer = AutoTokenizer.from_pretrained(
403
+ base_path,
404
+ cache_dir=base_path,
405
+ local_files_only=True,
406
+ )
407
+ assert self.tokenizer.is_fast # assume tokenizer.json is used
408
+
409
+ # Initialize lists and dictionaries for added tokens
410
+ self.added_tokens_list = []
411
+ self.added_tokens_dict = dict()
412
+ self.added_tokens_ids = set()
413
+
414
+ # Process added tokens
415
+ for tok, tokidx in sorted(
416
+ self.tokenizer.get_added_vocab().items(), key=lambda x: x[1]
417
+ ):
418
+ # Only consider added tokens that are not in the base vocabulary
419
+ if tokidx >= self.tokenizer.vocab_size:
420
+ self.added_tokens_list.append(tok)
421
+ self.added_tokens_dict[tok] = tokidx
422
+ self.added_tokens_ids.add(tokidx)
423
+
424
+ # Store special tokens and their IDs
425
+ self.specials = {
426
+ tok: self.tokenizer.get_vocab()[tok]
427
+ for tok in self.tokenizer.all_special_tokens
428
+ }
429
+ self.special_ids = set(self.tokenizer.all_special_ids)
430
+
431
+ # Set vocabulary sizes
432
+ self.vocab_size_base = self.tokenizer.vocab_size
433
+ self.vocab_size = self.vocab_size_base + len(self.added_tokens_list)
434
+
435
+ self.fname_tokenizer = fname_tokenizer
436
+
437
+ def hf_tokens(self) -> Iterable[tuple[bytes, float, gguf.TokenType]]:
438
+ reverse_vocab = {
439
+ id: encoded_tok for encoded_tok, id in self.tokenizer.get_vocab().items()
440
+ }
441
+
442
+ for token_id in range(self.vocab_size_base):
443
+ # Skip processing added tokens here
444
+ if token_id in self.added_tokens_ids:
445
+ continue
446
+
447
+ # Convert token text to bytes
448
+ token_text = reverse_vocab[token_id].encode("utf-8")
449
+
450
+ # Yield token text, score, and type
451
+ yield token_text, self.get_token_score(token_id), self.get_token_type(
452
+ token_id, token_text, self.special_ids # Reuse already stored special IDs
453
+ )
454
+
455
+ def get_token_type(self, token_id: int, token_text: bytes, special_ids: set[int]) -> gguf.TokenType:
456
+ # Special case for byte tokens
457
+ if re.fullmatch(br"<0x[0-9A-Fa-f]{2}>", token_text):
458
+ return gguf.TokenType.BYTE
459
+
460
+ # Determine token type based on whether it's a special token
461
+ return gguf.TokenType.CONTROL if token_id in special_ids else gguf.TokenType.NORMAL
462
+
463
+ def get_token_score(self, token_id: int) -> float:
464
+ # Placeholder for actual logic to determine the token's score
465
+ # This needs to be implemented based on specific requirements
466
+ return -1000.0 # Default score
467
+
468
+ def added_tokens(self) -> Iterable[tuple[bytes, float, gguf.TokenType]]:
469
+ for text in self.added_tokens_list:
470
+ if text in self.specials:
471
+ toktype = self.get_token_type(self.specials[text], b'', self.special_ids)
472
+ score = self.get_token_score(self.specials[text])
473
+ else:
474
+ toktype = gguf.TokenType.USER_DEFINED
475
+ score = -1000.0
476
+
477
+ yield text.encode("utf-8"), score, toktype
478
+
479
+ def has_newline_token(self):
480
+ return "<0x0A>" in self.tokenizer.vocab or "\n" in self.tokenizer.vocab
481
+
482
+ def all_tokens(self) -> Iterable[tuple[bytes, float, gguf.TokenType]]:
483
+ yield from self.hf_tokens()
484
+ yield from self.added_tokens()
485
+
486
+ def __repr__(self) -> str:
487
+ return f"<LlamaHfVocab with {self.vocab_size_base} base tokens and {len(self.added_tokens_list)} added tokens>"
bigdl/cpp/libs/common.lib CHANGED
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
Binary file
Binary file
Binary file
Binary file
bigdl/cpp/libs/llama.dll CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
bigdl/cpp/libs/ollama.exe CHANGED
Binary file
Binary file
Binary file
Binary file
@@ -9,11 +9,16 @@ set "destination_folder=%cd%"
9
9
  pushd "%lib_dir%"
10
10
  for %%f in (*) do (
11
11
  if not "%%f"=="ollama.exe" (
12
+ if exist "%destination_folder%\%%~nxf" (
13
+ del /f "%destination_folder%\%%~nxf"
14
+ )
12
15
  mklink "%destination_folder%\%%~nxf" "%%~ff"
13
16
  )
14
17
  )
15
18
  popd
16
19
 
17
- copy "%cpp_dir%\convert.py" .
18
- copy "%cpp_dir%\convert-hf-to-gguf.py" .
20
+ copy "%cpp_dir%\convert_hf_to_gguf.py" .
21
+ copy "%cpp_dir%\convert_hf_to_gguf_update.py" .
22
+ copy "%cpp_dir%\convert_llama_ggml_to_gguf.py" .
23
+ copy "%cpp_dir%\convert_lora_to_gguf.py" .
19
24
  xcopy /E /I "%cpp_dir%\gguf-py\" .\gguf-py
@@ -0,0 +1,16 @@
1
+ @echo off
2
+ for /f "delims=" %%i in ('python -c "import bigdl.cpp; print(bigdl.cpp.__file__)"') do set "cpp_file=%%i"
3
+ for %%a in ("%cpp_file%") do set "cpp_dir=%%~dpa"
4
+
5
+ set "cpp_dir=%cpp_dir:~0,-1%"
6
+ set "lib_dir=%cpp_dir%\libs"
7
+
8
+ :: Create symlinks for DLLs and EXE
9
+ for %%f in (ollama.exe ollama-lib.exe ollama_llama.dll ollama_ggml.dll ollama_llava_shared.dll ollama-ggml-base.dll ollama-ggml-cpu.dll ollama-ggml-sycl.dll libc++.dll) do (
10
+ if exist "%cd%\%%f" del /f "%cd%\%%f"
11
+ mklink "%cd%\%%f" "%lib_dir%\%%f"
12
+ )
13
+
14
+ :: Create symlink for dist directory
15
+ if exist "%cd%\dist" rmdir /s /q "%cd%\dist"
16
+ mklink /D "%cd%\dist" "%lib_dir%\dist"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: bigdl-core-cpp
3
- Version: 2.1.0b20240820.post1
3
+ Version: 2.2.0b20250217.post0
4
4
  Summary: Large Language Model Develop Toolkit
5
5
  Author: BigDL Authors
6
6
  License: Apache License, Version 2.0
@@ -10,9 +10,13 @@ Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: Implementation :: CPython
11
11
  Requires-Dist: torch==2.2.0
12
12
  Requires-Dist: numpy==1.26.4
13
- Requires-Dist: transformers<5.0.0,>=4.35.2
13
+ Requires-Dist: transformers==4.44.2
14
14
  Requires-Dist: sentencepiece~=0.1.98
15
- Requires-Dist: accelerate==0.21.0
15
+ Requires-Dist: accelerate==0.33.0
16
16
  Requires-Dist: protobuf<5.0.0,>=4.21.0
17
17
  Requires-Dist: gguf>=0.1.0
18
-
18
+ Dynamic: author
19
+ Dynamic: classifier
20
+ Dynamic: license
21
+ Dynamic: requires-dist
22
+ Dynamic: summary
@@ -0,0 +1,56 @@
1
+ bigdl/cpp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ bigdl/cpp/convert_hf_to_gguf.py,sha256=HVJ6axht-K3DAmmkVkC1T1_vZJ8FprUwfNpXJKnLsUQ,210336
3
+ bigdl/cpp/convert_hf_to_gguf_update.py,sha256=4A9Q4oLh5tZAovmgKgS7bVlcCqcVm4j0SIwGK_lww9s,17004
4
+ bigdl/cpp/convert_llama_ggml_to_gguf.py,sha256=0dKjRhmFzvWV4e-cuLmaeW14JrWUtZwerBmz8mYyMvI,19556
5
+ bigdl/cpp/convert_lora_to_gguf.py,sha256=b2CUmTK-ztrJE_50DzsXK3SRZshr_LYFyUPn0UDnkiA,17270
6
+ bigdl/cpp/gguf-py/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ bigdl/cpp/gguf-py/gguf/__init__.py,sha256=h5GWs6SMXYR8giWZ7MTZzAc3hYsIJF-HAkdxtgXLOPo,228
8
+ bigdl/cpp/gguf-py/gguf/constants.py,sha256=hN1QPaL74Ef8iJXFE2hlRJmG1w43a2E6HwB0xCxp8ic,61425
9
+ bigdl/cpp/gguf-py/gguf/gguf.py,sha256=QpLc-xU055W2d7CEFvJp2gLIfGO63bdM24ZndZCH6rw,493
10
+ bigdl/cpp/gguf-py/gguf/gguf_reader.py,sha256=PUrx08ZwaUOz1gLw5JQ459Hi7JIeCdlHgZX7wXcTqbI,12702
11
+ bigdl/cpp/gguf-py/gguf/gguf_writer.py,sha256=e-8gwsdq0sipd8zzrXvvtVWV7mCaQD9fRsCn6_67CNs,38541
12
+ bigdl/cpp/gguf-py/gguf/lazy.py,sha256=YIYxGBWD-oKXU4HOvpHs9eiEn81HUgeSmt1mmHJlbdM,8814
13
+ bigdl/cpp/gguf-py/gguf/metadata.py,sha256=oBTb4DXi_h1L_gYm8x_JRVuEPR4GHlVHuM-iN0OxWoY,33244
14
+ bigdl/cpp/gguf-py/gguf/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ bigdl/cpp/gguf-py/gguf/quants.py,sha256=2z6vcK-kBefqZbYNmSEVmdZF_tXHeVb5NC6jCbBdgKc,62040
16
+ bigdl/cpp/gguf-py/gguf/tensor_mapping.py,sha256=tUkpDyeMXwf9M1Cx1HL2g6mMavngsj0UYkeWMaOPjQU,35561
17
+ bigdl/cpp/gguf-py/gguf/utility.py,sha256=LAwLstUlosYQ1oX9LlJZ-1uCmwyNtOFcJfXpkLnju0k,3003
18
+ bigdl/cpp/gguf-py/gguf/vocab.py,sha256=ulUC8XudFDuZC2SNKGNQpsU2KFP_YhkyNLIWV16jG6I,20816
19
+ bigdl/cpp/libs/common.lib,sha256=I80cerGi_rO_f-4l1Xbu0QQbKItt4ghUL2SFOGDsbco,3959018
20
+ bigdl/cpp/libs/ggml-base.dll,sha256=5xmktVB3LOdg_p0kx_bBL5Wp4H9aSda6u3eAEUKN8-E,459264
21
+ bigdl/cpp/libs/ggml-cpu.dll,sha256=YP8_je-TQG7xX1c2yK5FgGGOBlEdD94G5aOZyteVAyU,475648
22
+ bigdl/cpp/libs/ggml-sycl.dll,sha256=j3VBlit3Va0N-DnE9GK4iGtWVYDUFhDq9RVG7B_l29c,5320704
23
+ bigdl/cpp/libs/ggml.dll,sha256=Avn1QcErEoUg3RMbIrAL7okQ1K6AOQTZhP8DAf8VH9U,113152
24
+ bigdl/cpp/libs/libc++.dll,sha256=U0TVK2WfFQIJPP6Bz9SeJmgskm2iqZWJorx_DGdfKIw,1561600
25
+ bigdl/cpp/libs/llama-batched.exe,sha256=qDITW77ThxP9GPS5Jpu5vI39JVGVMop44dXP4LG0Tm0,847872
26
+ bigdl/cpp/libs/llama-bench.exe,sha256=GAAjYxwGYO7AQr74aWJ2R7uBTArWBG8ScYzSqnsq0CI,277504
27
+ bigdl/cpp/libs/llama-cli.exe,sha256=MkZSMDnfGlWC5PD1vl7iOSMb4_qzQSMs9JASE9Cq1ZQ,924672
28
+ bigdl/cpp/libs/llama-embedding.exe,sha256=8i7uN5RsBCJblZo3hLeXW3Mf33B7KB12mfhAWSk88y4,871936
29
+ bigdl/cpp/libs/llama-gguf.exe,sha256=cupkKW1QwiBdJVLVNVq9qDUDuCqLf8f5H6_-6siGMo4,58880
30
+ bigdl/cpp/libs/llama-llava-cli.exe,sha256=LXhosg6qEvdUdD0eGZRMRFxSUTNu8EulsY_3KhKaTDE,1109504
31
+ bigdl/cpp/libs/llama-lookup.exe,sha256=AbshrJaQgSc2Si_8gGQCipFvqm0yYCZfCJKW-vfgGO4,906240
32
+ bigdl/cpp/libs/llama-ls-sycl-device.exe,sha256=IdUcSYTunI-_b-YmL3NTWffXVsFiIXhjnEDAGknhcG8,10240
33
+ bigdl/cpp/libs/llama-minicpmv-cli.exe,sha256=tDB5fDOh_VXPXMSXKcaRTElOYClcspML9CqngUAlrmY,1107456
34
+ bigdl/cpp/libs/llama-perplexity.exe,sha256=50vvmS9ra03mliFkv91hfpJcGvgHqK14G-IexA0pkyU,992256
35
+ bigdl/cpp/libs/llama-quantize.exe,sha256=29XGKWvVIEA5sJ0CL0THI8n2fT-4LEPoMfJF7jXmV_E,122880
36
+ bigdl/cpp/libs/llama-server.exe,sha256=Ff8HoZ3FtZAFrbkKYBCIqOscMj1W8jIZ2LLQMhoJMII,2150400
37
+ bigdl/cpp/libs/llama-simple.exe,sha256=tR2BLO3TbkQy5SW4ODArFCmYx0AvRGrsqar7aUpxlPE,62464
38
+ bigdl/cpp/libs/llama-speculative.exe,sha256=zq_JcdTeg7kxepgZ1GGsXX2-rmYAP1qzMiMLpeBUvYg,909312
39
+ bigdl/cpp/libs/llama-tokenize.exe,sha256=WinI4OZLrWN6YY_StX5S2R0f_JT12_2aZ9neF3RxO_4,88576
40
+ bigdl/cpp/libs/llama.dll,sha256=Pa1nklrJjmDEWiEw2Y5ZOnhsnJdpKxd_QBGmLBv2b3E,1411584
41
+ bigdl/cpp/libs/llava_shared.dll,sha256=0p3Zy-vTFn3VYARrUMCoI2W2faCIP5jkuEav6oVe1Mk,365056
42
+ bigdl/cpp/libs/ollama-ggml-base.dll,sha256=AklQ59W_49cMZyD0BHiKT24ulxxzVpHYBkNldc41jeM,459776
43
+ bigdl/cpp/libs/ollama-ggml-cpu.dll,sha256=YqlGRXKLRshHKsEE5NOK1OkQBHDP7CmBIEOwiomxH7k,475648
44
+ bigdl/cpp/libs/ollama-ggml-sycl.dll,sha256=m5VIs___9UNDoAn7F47yB0GrT7myI-ktdN-uv_cIr2Y,5317120
45
+ bigdl/cpp/libs/ollama-lib.exe,sha256=7hf6qHgXBlMBdCvHOIMrVMfjJ0KE3LHoy2lcP1vndxw,25980928
46
+ bigdl/cpp/libs/ollama.exe,sha256=Jkkdqfkg5dCmvCCfLqNNATwOj0cjpmEox6r-esK-3CU,35840
47
+ bigdl/cpp/libs/ollama_ggml.dll,sha256=EOJUhwdHhDbBHG3AsXA9VPHv_0ArtJA3pHws-foNOZg,113152
48
+ bigdl/cpp/libs/ollama_llama.dll,sha256=qT5BBGL1eUoDgqhp8zcUVRu3QmyNrJt0lpQdykjE0Lw,1434112
49
+ bigdl/cpp/libs/ollama_llava_shared.dll,sha256=sujCN-BFMoX51-I1_O5Rq0XK4vh1oGnF-Y97bTutuJI,365056
50
+ bigdl_core_cpp-2.2.0b20250217.post0.data/scripts/init-llama-cpp.bat,sha256=U0h6RifZxL3GGJp-0dxdZapQIvXUATSj644CURJL-lg,751
51
+ bigdl_core_cpp-2.2.0b20250217.post0.data/scripts/init-llama-cpp.ps1,sha256=JFOylLxO4MKpllHhdbPuJ1xHi9azxDpzdJns8JtZpkU,501
52
+ bigdl_core_cpp-2.2.0b20250217.post0.data/scripts/init-ollama.bat,sha256=0I2iBOFv3kR9hvEySGMRUU52-qwVhE7oRZnyWz-2z_U,657
53
+ bigdl_core_cpp-2.2.0b20250217.post0.dist-info/METADATA,sha256=Rq1x88jz-oYXcU_NmCfdVpkauBRye9XsDl9IbCH3t_M,756
54
+ bigdl_core_cpp-2.2.0b20250217.post0.dist-info/WHEEL,sha256=2wr--P33L_Xt79Mrb57-zn6CrTlNaEVHEwbOduMxJRg,97
55
+ bigdl_core_cpp-2.2.0b20250217.post0.dist-info/top_level.txt,sha256=iGuLfZARD_qANcIMfy0tbbrC3EtCg6BSiH8icc3dLWs,6
56
+ bigdl_core_cpp-2.2.0b20250217.post0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.1.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-win_amd64
5
5