# Copyright (c) 2026 Edison dos Santos # Licensed under the Apache License 2.0 (see LICENSE file in root) # Part of Ghost Assistant: https://github.com/Edison2ST/GhostAssistantONNXFiles import sentencepiece as spm import json s = spm.SentencePieceProcessor(model_file="CACHE PATH") # REPLACE WITH YOUR CACHE MODEL # Create the dictionary according to the sentencepieceprocessor vocab = {i: s.id_to_piece(i) for i in range(s.get_piece_size())} with open("vocab.json", "w", encoding="utf-8") as f: json.dump(vocab, f, ensure_ascii=False, indent=4)