Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues of converting safetensors to gguf with convert.py #5278

Closed
592319702 opened this issue Feb 2, 2024 · 3 comments
Closed

Issues of converting safetensors to gguf with convert.py #5278

592319702 opened this issue Feb 2, 2024 · 3 comments

Comments

@592319702
Copy link

592319702 commented Feb 2, 2024

I want to convert safetensors to gguf with convert.py
But I hit the issue as follow,
(mlx) I542464@DY4GPKX1J0 llama.cpp % python convert.py ../mlx-examples/lora/lora_fused_model/My-Mistral-7B-fine-tuned Loading model file ../mlx-examples/lora/lora_fused_model/My-Mistral-7B-fine-tuned/model-00001-of-00003.safetensors Loading model file ../mlx-examples/lora/lora_fused_model/My-Mistral-7B-fine-tuned/model-00001-of-00003.safetensors Loading model file ../mlx-examples/lora/lora_fused_model/My-Mistral-7B-fine-tuned/model-00002-of-00003.safetensors Loading model file ../mlx-examples/lora/lora_fused_model/My-Mistral-7B-fine-tuned/model-00003-of-00003.safetensors params = Params(n_vocab=32000, n_embd=4096, n_layer=32, n_ctx=32768, n_ff=14336, n_head=32, n_head_kv=8, n_experts=None, n_experts_used=None, f_norm_eps=1e-05, rope_scaling_type=None, f_rope_freq_base=10000.0, f_rope_scale=None, n_orig_ctx=None, rope_finetuned=None, ftype=None, path_model=PosixPath('../mlx-examples/lora/lora_fused_model/My-Mistral-7B-fine-tuned')) Found vocab files: {'tokenizer.model': None, 'vocab.json': None, 'tokenizer.json': PosixPath('../mlx-examples/lora/lora_fused_model/My-Mistral-7B-fine-tuned/tokenizer.json')} Loading vocab file '../mlx-examples/lora/lora_fused_model/My-Mistral-7B-fine-tuned/tokenizer.json', type 'spm' Traceback (most recent call last): File "/Users/I542464/mlx-test/llama.cpp/convert.py", line 1474, in <module> main() File "/Users/I542464/mlx-test/llama.cpp/convert.py", line 1442, in main vocab, special_vocab = vocab_factory.load_vocab(args.vocab_type, model_parent_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/I542464/mlx-test/llama.cpp/convert.py", line 1328, in load_vocab vocab = SentencePieceVocab( ^^^^^^^^^^^^^^^^^^^ File "/Users/I542464/mlx-test/llama.cpp/convert.py", line 394, in __init__ self.sentencepiece_tokenizer = SentencePieceProcessor(str(fname_tokenizer)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/I542464/miniconda3/envs/mlx/lib/python3.11/site-packages/sentencepiece/__init__.py", line 447, in Init self.Load(model_file=model_file, model_proto=model_proto) File "/Users/I542464/miniconda3/envs/mlx/lib/python3.11/site-packages/sentencepiece/__init__.py", line 905, in Load return self.LoadFromFile(model_file) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/I542464/miniconda3/envs/mlx/lib/python3.11/site-packages/sentencepiece/__init__.py", line 310, in LoadFromFile return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Internal: /Users/runner/work/sentencepiece/sentencepiece/src/sentencepiece_processor.cc(1102) [model_proto->ParseFromArray(serialized.data(), serialized.size())]

My model files is as follow,
config.json model-00002-of-00003.safetensors special_tokens_map.json tokenizer_config.json model-00001-of-00003.safetensors model-00003-of-00003.safetensors tokenizer.json

@Artefact2
Copy link
Collaborator

convert.py --vocab-type hfft

Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Mar 18, 2024
Copy link
Contributor

github-actions bot commented Apr 2, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants