Repository navigation
Description
%%capture
!pip install unsloth "xformers==0.0.28.post2"
Also get the latest nightly Unsloth!
!pip uninstall unsloth -y && pip install --upgrade --no-cache-dir "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
!pip install --upgrade --no-cache-dir --no-deps unsloth transformers git+https://github.com/huggingface/trl.git
AND
%%capture
!pip install unsloth "xformers==0.0.28.post2"
Also get the latest nightly Unsloth!
!pip uninstall unsloth -y && pip install --upgrade --no-cache-dir "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
#!pip install --upgrade --no-cache-dir --no-deps unsloth transformers git+https://github.com/huggingface/trl.git
Error is the same.
if True:
model.push_to_hub_gguf(
"HF/Model", # Change hf to your username!
tokenizer,
quantization_method = ["q4_0","q4_k_m","q5_k_m",],
token = "hf_KCorrect_Token_Here", # Get a token at https://huggingface.co/settings/tokens
)
Unsloth: [0] Installing llama.cpp. This will take 3 minutes...
Unsloth: [1] Converting model at XXX into f16 GGUF format.
The output location will be /content/CCC/dddd/unsloth.F16.gguf
This will take 3 minutes...
TypeError Traceback (most recent call last)
in <cell line: 1>()
1 if True:
----> 2 model.push_to_hub_gguf(
3 "HF/Model", # Change hf to your username!
4 tokenizer,
5 quantization_method = ["q4_0","q4_k_m","q5_k_m",],
4 frames
/usr/local/lib/python3.10/dist-packages/unsloth/save.py in unsloth_push_to_hub_gguf(self, repo_id, tokenizer, quantization_method, first_conversion, use_temp_dir, commit_message, private, token, max_shard_size, create_pr, safe_serialization, revision, commit_description, tags, temporary_location, maximum_memory_usage)
1859
1860 # Save to GGUF
-> 1861 all_file_locations, want_full_precision = save_to_gguf(
1862 model_type, model_dtype, is_sentencepiece_model,
1863 new_save_directory, quantization_method, first_conversion, makefile,
/usr/local/lib/python3.10/dist-packages/unsloth/save.py in save_to_gguf(model_type, model_dtype, is_sentencepiece, model_directory, quantization_method, first_conversion, _run_installer)
1091 vocab_type = "spm,hfft,bpe"
1092 # Fix Sentencepiece model as well!
-> 1093 fix_sentencepiece_gguf(model_directory)
1094 else:
1095 vocab_type = "bpe"
/usr/local/lib/python3.10/dist-packages/unsloth/tokenizer_utils.py in fix_sentencepiece_gguf(saved_location)
402 """
403 from copy import deepcopy
--> 404 from transformers.utils import sentencepiece_model_pb2
405 import json
406 from enum import IntEnum
/usr/local/lib/python3.10/dist-packages/transformers/utils/sentencepiece_model_pb2.py in
26
27
---> 28 DESCRIPTOR = _descriptor.FileDescriptor(
29 name="sentencepiece_model.proto",
30 package="sentencepiece",
/usr/local/lib/python3.10/dist-packages/google/protobuf/descriptor.py in new(cls, name, package, options, serialized_options, serialized_pb, dependencies, public_dependencies, syntax, pool, create_key)
1022 raise RuntimeError('Please link in cpp generated lib for %s' % (name))
1023 elif serialized_pb:
-> 1024 return _message.default_pool.AddSerializedFile(serialized_pb)
1025 else:
1026 return super(FileDescriptor, cls).new(cls)
TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "sentencepiece_model.proto":
sentencepiece_model.proto: A file with this name is already in the pool.
This happened last week too, IIRC it was a transformers thing then, but I can't find a work around.
Activity
CurtiusSimplus commentedon Nov 8, 2024
Still not change ... will save 16 bit merged and Lora but not the GGUF ... that error comes up ... OH well.
CurtiusSimplus commentedon Nov 8, 2024
Using Vanilla new script with ONLY MY TOKEN and HF name model added to save.gguf part of code ..
https://colab.research.google.com/drive/1PrX2o1VXJJfG1n8GXpzpBr3qY9NPgucM?usp=sharing
This works ... So the issue is with my code some place ... Let me see if I can substitute my MODEL and HF TOKEN to test.
Will report back
CurtiusSimplus commentedon Nov 8, 2024
My model fails with the identical code ... So it is the model.
IDK
CurtiusSimplus commentedon Nov 9, 2024
Still off and on ... And I am using this code to start the scripts:
%%capture
!pip install unsloth "xformers==0.0.28.post2"
Also get the latest nightly Unsloth!
!pip uninstall unsloth -y && pip install --upgrade --no-cache-dir "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
Nemo saved. As expected.
Small Mistral. Failed. Same error as above.
Mistral 7b instruct. Failed. Same error as above. ( used your provided script only added HF user name and tokens at indicated place in code and increased context window to their max. )
But A fine tune of Dolphin 2.9.3 iirc THAT WORKED PERFECTLY. (Changed model in above script. This worked above errored.)
So it seems to be BOTH model and TRL dependent but that is above my level ...
I can save all as Merged 16 bit and Lora so they are not lost. Just GGUF is giving me a go again.
CurtiusSimplus commentedon Nov 9, 2024
I have tried a new HF token as well ... NO dice. The old one is valid and working for pushing Merged model to HF well and in order. ONLY GGUF ... Have tried all sorts of things.
The manual save ... I can't figure out how to use ... above my level that is all.
CurtiusSimplus commentedon Nov 10, 2024
Still an issue ... Can save using manual but it won't push to HF as GGUF ...
danielhanchen commentedon Nov 11, 2024
Hmm so Mistral 7b Instruct is the main culprit? @Erland366 Can you take a look at exporting Mistral Instruct thanks
CurtiusSimplus commentedon Nov 11, 2024
Yes basically Mistral 7b instruct and its 'clones' seem to have issues.
Thanks a lot again.
Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION to 'python' to address issue
Revert "Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION to 'python' to add…
Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION to 'python' to address issue
Fix/export mistral (#1281)
Bug fixes (#1288)
danielhanchen commentedon Nov 14, 2024
@CurtiusSimplus The problem might have been fixed in Colab / Kaggle (local machines need
pip install --upgrade --no-cache-dir --no-deps unsloth) - could you try it again thanks!! If it still breaks I'll investigate furtherVision support (#1315)
6 remaining items
Bug Fixes (#1470)
Bug fixes (#1473)
ZelphirKaltstahl commentedon Oct 19, 2025
Still happening in the Google Colab Jupyter notebook, that is linked from the readme. Official readme example for Mistral is not working.
If this is unfixable from Unsloth's side of things, it would be good to state this in the readme as well, to not waste people's time trying to fix the example, or try to create local setups, in hoping it might work locally. I personally spent a few hours on this issue, not knowing about this Mistral problem. Would have saved me a great deal of time and disappointment, if it simply had been mentioned in the readme, where the example colab notebooks are linked.
Fix/export mistral (unslothai#1281)
Bug fixes (unslothai#1288)
Vision support (unslothai#1315)
Bug fixes for vision (unslothai#1340)
Fix llama.cpp GGUF (unslothai#1375)
Dynamic quants (unslothai#1379)
Fix vision model tokenizer padding side. (unslothai#1384)
Llama 3.3 (unslothai#1393)
Bug fixes (unslothai#1458)
Bug Fixes (unslothai#1470)
Bug fixes (unslothai#1473)