reinstate original gguf package import and fix type annotation

This commit is contained in:
Christian Zhou-Zheng 2024-06-07 21:09:03 -04:00
parent 9576965ce7
commit c6ae1d6799

View file

@ -23,9 +23,7 @@ if TYPE_CHECKING:
if 'NO_LOCAL_GGUF' not in os.environ: if 'NO_LOCAL_GGUF' not in os.environ:
sys.path.insert(1, str(Path(__file__).parent / 'gguf-py')) sys.path.insert(1, str(Path(__file__).parent / 'gguf-py'))
import importlib import gguf
gguf = importlib.import_module("gguf-py.gguf")
# import gguf
logger = logging.getLogger("hf-to-gguf") logger = logging.getLogger("hf-to-gguf")
@ -60,7 +58,7 @@ class Model:
tensor_map: gguf.TensorNameMap tensor_map: gguf.TensorNameMap
tensor_names: set[str] | None tensor_names: set[str] | None
fname_out: Path fname_out: Path
gguf_writer: gguf.GGUFWriter gguf_writer: gguf.GGUFWriterSplit
# subclasses should define this! # subclasses should define this!
model_arch: gguf.MODEL_ARCH model_arch: gguf.MODEL_ARCH