gguf.py : merge all files in gguf.py

This commit is contained in:
Georgi Gerganov 2023-08-16 19:55:49 +03:00
parent 88b5769487
commit c8ee87f141
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
6 changed files with 213 additions and 207 deletions

View file

@ -3,18 +3,17 @@
# HF files required in the model dir: config.json tokenizer_config.json tokenizer.json tokenizer.model
import gguf
import gguf_namemap as tmap
import os
import sys
import struct
import json
import numpy as np
import torch
from typing import Any, List
from pathlib import Path
from sentencepiece import SentencePieceProcessor
#NDArray = np.ndarray[Any, Any]
# compatible with python < 3.9
NDArray: 'TypeAlias' = 'np.ndarray[Any, Any]'
@ -189,7 +188,7 @@ if Path(dir_model + "/tokenizer.json").is_file():
# TENSORS
tensor_map = tmap.get_tensor_namemap(block_count)
tensor_map = gguf.get_tensor_name_map(block_count)
# tensor info
print("gguf: get tensor metadata")