From aeefac4ff760acea5afe66fbfe8d7eca1937b79c Mon Sep 17 00:00:00 2001 From: Kerfuffle <44031344+KerfuffleV2@users.noreply.github.com> Date: Thu, 31 Aug 2023 16:49:24 -0600 Subject: scripts: Use local gguf package when running from repo (#2927) * scripts: Use local gguf when running from repo --- convert.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'convert.py') diff --git a/convert.py b/convert.py index 9a39edb9..5cc3f6e6 100755 --- a/convert.py +++ b/convert.py @@ -25,10 +25,14 @@ from dataclasses import dataclass from pathlib import Path from typing import IO, TYPE_CHECKING, Any, Callable, Generator, Iterable, Literal, Sequence, TypeVar -import gguf import numpy as np from sentencepiece import SentencePieceProcessor # type: ignore[import] +import os +if 'NO_LOCAL_GGUF' not in os.environ: + sys.path.insert(1, str(Path(__file__).parent / 'gguf-py' / 'gguf')) +import gguf + if TYPE_CHECKING: from typing import TypeAlias -- cgit v1.2.3