mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-27 03:44:35 +00:00
gguf : write tokenizer data
This commit is contained in:
parent
8a76dd8a85
commit
cc3dd7f042
9
gguf.py
9
gguf.py
@ -267,6 +267,15 @@ class GGUFWriter:
|
||||
def write_rope_scale(self, llm: str, value: float):
|
||||
self.write_float32(constants.KEY_ROPE_SCALE.format(llm=llm), value)
|
||||
|
||||
def write_tokenizer_model(self, model: str):
|
||||
self.write_string(constants.KEY_TOKENIZER_MODEL, model)
|
||||
|
||||
def write_token_list(self, tokens: List[str]):
|
||||
self.write_array(constants.KEY_TOKENIZER_LIST, tokens)
|
||||
|
||||
def write_token_scores(self, scores: List[float]):
|
||||
self.write_array(constants.KEY_TOKENIZER_SCORES, scores)
|
||||
|
||||
|
||||
# Example usage:
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
Reference in New Issue
Block a user