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 --- examples/train-text-from-scratch/convert-train-checkpoint-to-gguf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples/train-text-from-scratch') diff --git a/examples/train-text-from-scratch/convert-train-checkpoint-to-gguf.py b/examples/train-text-from-scratch/convert-train-checkpoint-to-gguf.py index 01b3ee92..a527d615 100644 --- a/examples/train-text-from-scratch/convert-train-checkpoint-to-gguf.py +++ b/examples/train-text-from-scratch/convert-train-checkpoint-to-gguf.py @@ -2,13 +2,16 @@ # train-text-from-scratch checkpoint --> gguf conversion import argparse -import gguf import os import struct import sys import numpy as np from pathlib import Path +if 'NO_LOCAL_GGUF' not in os.environ: + sys.path.insert(1, str(Path(__file__).parent / '..' / '..' / 'gguf-py' / 'gguf')) +import gguf + # gguf constants LLM_KV_OPTIMIZER_TYPE = "optimizer.type" LLM_KV_OPTIMIZER_TYPE_ADAM = "adam" -- cgit v1.2.3