Skip to content

Commit 9336db4

Browse files
authored
convert : XLMRoberta Type Vocab Size (#10458)
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 <[email protected]>
1 parent 96fa2c5 commit 9336db4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

convert_hf_to_gguf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2707,7 +2707,7 @@ def set_vocab(self):
27072707
self.gguf_writer.add_token_scores(scores)
27082708
self.gguf_writer.add_token_types(toktypes)
27092709
self.gguf_writer.add_add_space_prefix(add_prefix)
2710-
self.gguf_writer.add_token_type_count(1)
2710+
self.gguf_writer.add_token_type_count(self.hparams.get("type_vocab_size", 1))
27112711
self.gguf_writer.add_remove_extra_whitespaces(remove_whitespaces)
27122712
if precompiled_charsmap:
27132713
self.gguf_writer.add_precompiled_charsmap(precompiled_charsmap)

0 commit comments

Comments
 (0)