From 902de8826b325afbdb5eda4c6895b6e588bede09 Mon Sep 17 00:00:00 2001 From: Francis Couture-Harpin Date: Thu, 4 Jul 2024 16:08:15 -0400 Subject: [PATCH] gguf-py : use snake_case in scripts entrypoint export --- examples/json_schema_pydantic_example.py | 2 +- gguf-py/scripts/__init__.py | 17 ++++------------- scripts/check-requirements.sh | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/examples/json_schema_pydantic_example.py b/examples/json_schema_pydantic_example.py index 2a24f8118..c7ca7b8d9 100644 --- a/examples/json_schema_pydantic_example.py +++ b/examples/json_schema_pydantic_example.py @@ -1,7 +1,7 @@ # Usage: #! ./llama-server -m some-model.gguf & #! pip install pydantic -#! python json-schema-pydantic-example.py +#! python json_schema_pydantic_example.py from pydantic import BaseModel, Extra, TypeAdapter from annotated_types import MinLen diff --git a/gguf-py/scripts/__init__.py b/gguf-py/scripts/__init__.py index 1ad45639a..f9d29cb69 100644 --- a/gguf-py/scripts/__init__.py +++ b/gguf-py/scripts/__init__.py @@ -1,13 +1,4 @@ -import os - -from importlib import import_module - - -os.environ["NO_LOCAL_GGUF"] = "TRUE" - -gguf_convert_endian_entrypoint = import_module("scripts.gguf-convert-endian").main -gguf_dump_entrypoint = import_module("scripts.gguf-dump").main -gguf_set_metadata_entrypoint = import_module("scripts.gguf-set-metadata").main -gguf_new_metadata_entrypoint = import_module("scripts.gguf-new-metadata").main - -del import_module, os +from .gguf_convert_endian import main as gguf_convert_endian_entrypoint +from .gguf_dump import main as gguf_dump_entrypoint +from .gguf_set_metadata import main as gguf_set_metadata_entrypoint +from .gguf_new_metadata import main as gguf_new_metadata_entrypoint diff --git a/scripts/check-requirements.sh b/scripts/check-requirements.sh index 27f264999..48f924c02 100755 --- a/scripts/check-requirements.sh +++ b/scripts/check-requirements.sh @@ -97,7 +97,7 @@ check_requirements() { } check_convert_script() { - local py=$1 # e.g. convert_hf_to_gguf.py + local py=$1 # e.g. ./convert_hf_to_gguf.py local pyname=${py##*/} # e.g. convert_hf_to_gguf.py pyname=${pyname%.py} # e.g. convert_hf_to_gguf