Skip to content

Commit da28543

Browse files
mikekgfbmalfet
authored andcommitted
fix gguf loader (#196)
* fix gguf loader * group_size -> groupsize * dangling reference * gix ggf_utils to use fqn * typo * fqn * circular import * more fqn
1 parent a3cda44 commit da28543

File tree

5 files changed

+17
-409
lines changed

5 files changed

+17
-409
lines changed

.github/workflows/gguf_load.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Load files
4242
run: |
4343
touch test.py
44-
echo "from gguf_loader import load_llama_from_gguf_file" >> test.py
44+
echo "from build.gguf_loader import load_llama_from_gguf_file" >> test.py
4545
echo "pt = load_llama_from_gguf_file(\"gguf_files/llama-2-7b.Q4_0.gguf\")" >> test.py
4646
cat test.py
4747
python test.py

build/gguf_loader.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
from pathlib import Path
1414
from typing import Any, Mapping, Dict
1515
import logging
16-
from quantize import WeightOnlyInt4Linear, pack_scales_and_zeros, group_dequantize_tensor_from_qparams
17-
from gguf_util import F16, F32, Q4_0, Q6_K
16+
from quantize import (
17+
WeightOnlyInt4Linear, pack_scales_and_zeros, group_dequantize_tensor_from_qparams
18+
)
19+
from build.gguf_util import F16, F32, Q4_0, Q6_K
1820
import gguf
1921

2022
import torch

eval.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ def main(args) -> None:
254254
max_seq_length,
255255
)
256256
print(f"Time to run eval: {time.time() - t1:.02f} seconds.")
257-
if dso_path:
257+
if builder_args.dso_path:
258258
print(f"For model {builder_args.dso_path}")
259-
elif pte_path:
259+
elif builder_args.pte_path:
260260
print(f"For model {builder_args.pte_path}")
261-
elif checkpoint_path:
261+
elif builder_args.checkpoint_path:
262262
print(f"For model {builder_args.checkpoint_path}")
263-
elif checkpoint_dir:
263+
elif builder_args.checkpoint_dir:
264264
print(f"For model {builder_args.checkpoint_dir}")
265265
else:
266266
raise RuntimeError("Well That's Fine. How did we get here")
@@ -271,7 +271,7 @@ def main(args) -> None:
271271
if __name__ == '__main__':
272272
def cli():
273273
args = cli_args()
274-
eval_main(args)
274+
main(args)
275275

276276

277277
if __name__ == "__main__":

0 commit comments

Comments
 (0)