From 87509005a8675d6b60f246bf9f64b40834204ba7 Mon Sep 17 00:00:00 2001 From: Galunid Date: Fri, 24 May 2024 19:20:16 +0200 Subject: [PATCH] Fix gguf not imported correctly --- examples/convert-legacy-llama.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/convert-legacy-llama.py b/examples/convert-legacy-llama.py index 736b51ca8..fd8401015 100755 --- a/examples/convert-legacy-llama.py +++ b/examples/convert-legacy-llama.py @@ -29,7 +29,9 @@ from typing import TYPE_CHECKING, Any, Callable, IO, Iterable, Literal, TypeVar, import numpy as np if 'NO_LOCAL_GGUF' not in os.environ: - sys.path.insert(1, str(Path(__file__).parent / 'gguf-py')) + # use .parent.parent since we are in "examples" directory + sys.path.insert(1, str(Path(__file__).parent.parent / 'gguf-py')) + import gguf from gguf import BaseVocab, Vocab, NoVocab, BpeVocab, SentencePieceVocab, LlamaHfVocab