Fix gguf not imported correctly

This commit is contained in:
Galunid 2024-05-24 19:20:16 +02:00
parent 69729a34b5
commit 87509005a8

View file

@ -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