From 7e5e84fbb7f431f403e98ff6bcbfe10fe0c06ba3 Mon Sep 17 00:00:00 2001 From: cebtenzzre Date: Mon, 23 Oct 2023 22:18:50 -0400 Subject: [PATCH] python: change default extension to .gguf (#1559) --- gpt4all-bindings/python/gpt4all/gpt4all.py | 10 +++++----- gpt4all-bindings/python/setup.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gpt4all-bindings/python/gpt4all/gpt4all.py b/gpt4all-bindings/python/gpt4all/gpt4all.py index a1504ecf..f2494ebb 100644 --- a/gpt4all-bindings/python/gpt4all/gpt4all.py +++ b/gpt4all-bindings/python/gpt4all/gpt4all.py @@ -75,7 +75,7 @@ class GPT4All: Constructor Args: - model_name: Name of GPT4All or custom model. Including ".bin" file extension is optional but encouraged. + model_name: Name of GPT4All or custom model. Including ".gguf" file extension is optional but encouraged. model_path: Path to directory containing model file or, if file does not exist, where to download model. Default is None, in which case models will be stored in `~/.cache/gpt4all/`. model_type: Model architecture. This argument currently does not have any functionality and is just used as @@ -141,7 +141,7 @@ class GPT4All: Model config. """ - model_filename = append_bin_suffix_if_missing(model_name) + model_filename = append_extension_if_missing(model_name) # get the config for the model config: ConfigType = DEFAULT_MODEL_CONFIG @@ -201,7 +201,7 @@ class GPT4All: Download model from https://gpt4all.io. Args: - model_filename: Filename of model (with .bin extension). + model_filename: Filename of model (with .gguf extension). model_path: Path to download model to. verbose: If True (default), print debug messages. url: the models remote url (e.g. may be hosted on HF) @@ -456,7 +456,7 @@ def empty_chat_session(system_prompt: str = "") -> List[MessageType]: return [{"role": "system", "content": system_prompt}] -def append_bin_suffix_if_missing(model_name): +def append_extension_if_missing(model_name): if not model_name.endswith((".bin", ".gguf")): - model_name += ".bin" + model_name += ".gguf" return model_name diff --git a/gpt4all-bindings/python/setup.py b/gpt4all-bindings/python/setup.py index 1632ec0e..b967e59d 100644 --- a/gpt4all-bindings/python/setup.py +++ b/gpt4all-bindings/python/setup.py @@ -61,7 +61,7 @@ copy_prebuilt_C_lib(SRC_CLIB_DIRECtORY, setup( name=package_name, - version="2.0.0", + version="2.0.1", description="Python bindings for GPT4All", author="Nomic and the Open Source Community", author_email="support@nomic.ai",