Skip to content

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. #1266

Closed as not planned

Description

@CurtiusSimplus

%%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

  1. CurtiusSimplus commented on Nov 8, 2024

    @CurtiusSimplus
    Author

    Still not change ... will save 16 bit merged and Lora but not the GGUF ... that error comes up ... OH well.

  2. CurtiusSimplus commented on Nov 8, 2024

    @CurtiusSimplus
    Author

    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

  3. CurtiusSimplus commented on Nov 8, 2024

    @CurtiusSimplus
    Author

    My model fails with the identical code ... So it is the model.

    IDK

  4. CurtiusSimplus commented on Nov 9, 2024

    @CurtiusSimplus
    Author

    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.

  5. CurtiusSimplus commented on Nov 9, 2024

    @CurtiusSimplus
    Author

    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.

  6. CurtiusSimplus commented on Nov 10, 2024

    @CurtiusSimplus
    Author

    Still an issue ... Can save using manual but it won't push to HF as GGUF ...

  7. danielhanchen commented on Nov 11, 2024

    @danielhanchen
    Member

    Hmm so Mistral 7b Instruct is the main culprit? @Erland366 Can you take a look at exporting Mistral Instruct thanks

  8. CurtiusSimplus commented on Nov 11, 2024

    @CurtiusSimplus
    Author

    Yes basically Mistral 7b instruct and its 'clones' seem to have issues.

    Thanks a lot again.

  9. danielhanchen commented on Nov 14, 2024

    @danielhanchen
    Member

    @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 further

  10. added a commit that references this issue on Nov 21, 2024
  11. 6 remaining items

  12. added 2 commits that reference this issue on Dec 24, 2024
  13. ZelphirKaltstahl commented on Oct 19, 2025

    @ZelphirKaltstahl

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions