summaryrefslogtreecommitdiff
path: root/convert-falcon-hf-to-gguf.py
diff options
context:
space:
mode:
authorKerfuffle <44031344+KerfuffleV2@users.noreply.github.com>2023-08-31 16:49:24 -0600
committerGitHub <noreply@github.com>2023-08-31 16:49:24 -0600
commitaeefac4ff760acea5afe66fbfe8d7eca1937b79c (patch)
tree785cbf67f86773165b1d31471233a5539c6d67a1 /convert-falcon-hf-to-gguf.py
parente8422de39e4aa2f7e50574124b060a80607e654a (diff)
scripts: Use local gguf package when running from repo (#2927)
* scripts: Use local gguf when running from repo
Diffstat (limited to 'convert-falcon-hf-to-gguf.py')
-rwxr-xr-xconvert-falcon-hf-to-gguf.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/convert-falcon-hf-to-gguf.py b/convert-falcon-hf-to-gguf.py
index ec786ff6..271e5897 100755
--- a/convert-falcon-hf-to-gguf.py
+++ b/convert-falcon-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
+
def bytes_to_unicode():
# ref: https://github.com/openai/gpt-2/blob/master/src/encoder.py