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-gptneox-hf-to-gguf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'convert-gptneox-hf-to-gguf.py') diff --git a/convert-gptneox-hf-to-gguf.py b/convert-gptneox-hf-to-gguf.py index 852123d9..b9c8b460 100755 --- a/convert-gptneox-hf-to-gguf.py +++ b/convert-gptneox-hf-to-gguf.py @@ -11,11 +11,14 @@ import sys from pathlib import Path from typing import Any -import gguf import numpy as np import torch from transformers import AutoTokenizer # type: ignore[import] +if 'NO_LOCAL_GGUF' not in os.environ: + sys.path.insert(1, str(Path(__file__).parent / 'gguf-py' / 'gguf')) +import gguf + # ref: https://github.com/openai/gpt-2/blob/master/src/encoder.py -- cgit v1.2.3