]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
convert : XLMRoberta Type Vocab Size (#10458)
authorGabe Goodhart <redacted>
Sun, 24 Nov 2024 09:02:34 +0000 (02:02 -0700)
committerGitHub <redacted>
Sun, 24 Nov 2024 09:02:34 +0000 (11:02 +0200)
This matches the key in common bert-based embedding models and may have a
value other than 1 in it.

Branch: XLMRobertaTypeVocabSize

Signed-off-by: Gabe Goodhart <redacted>
convert_hf_to_gguf.py

index 9f4b8154b88a883d0bc8517d1cbc7460fc6dc3b6..80a179b86af7e8d151a787ca8eb480c141102b06 100755 (executable)
@@ -2707,7 +2707,7 @@ class XLMRobertaModel(BertModel):
         self.gguf_writer.add_token_scores(scores)
         self.gguf_writer.add_token_types(toktypes)
         self.gguf_writer.add_add_space_prefix(add_prefix)
-        self.gguf_writer.add_token_type_count(1)
+        self.gguf_writer.add_token_type_count(self.hparams.get("type_vocab_size", 1))
         self.gguf_writer.add_remove_extra_whitespaces(remove_whitespaces)
         if precompiled_charsmap:
             self.gguf_writer.add_precompiled_charsmap(precompiled_charsmap)