mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-06 09:20:33 +00:00
python: change default extension to .gguf (#1559)
This commit is contained in:
parent
37b007603a
commit
7e5e84fbb7
@ -75,7 +75,7 @@ class GPT4All:
|
|||||||
Constructor
|
Constructor
|
||||||
|
|
||||||
Args:
|
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.
|
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/`.
|
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
|
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 config.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
model_filename = append_bin_suffix_if_missing(model_name)
|
model_filename = append_extension_if_missing(model_name)
|
||||||
|
|
||||||
# get the config for the model
|
# get the config for the model
|
||||||
config: ConfigType = DEFAULT_MODEL_CONFIG
|
config: ConfigType = DEFAULT_MODEL_CONFIG
|
||||||
@ -201,7 +201,7 @@ class GPT4All:
|
|||||||
Download model from https://gpt4all.io.
|
Download model from https://gpt4all.io.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
model_filename: Filename of model (with .bin extension).
|
model_filename: Filename of model (with .gguf extension).
|
||||||
model_path: Path to download model to.
|
model_path: Path to download model to.
|
||||||
verbose: If True (default), print debug messages.
|
verbose: If True (default), print debug messages.
|
||||||
url: the models remote url (e.g. may be hosted on HF)
|
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}]
|
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")):
|
if not model_name.endswith((".bin", ".gguf")):
|
||||||
model_name += ".bin"
|
model_name += ".gguf"
|
||||||
return model_name
|
return model_name
|
||||||
|
@ -61,7 +61,7 @@ copy_prebuilt_C_lib(SRC_CLIB_DIRECtORY,
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=package_name,
|
name=package_name,
|
||||||
version="2.0.0",
|
version="2.0.1",
|
||||||
description="Python bindings for GPT4All",
|
description="Python bindings for GPT4All",
|
||||||
author="Nomic and the Open Source Community",
|
author="Nomic and the Open Source Community",
|
||||||
author_email="support@nomic.ai",
|
author_email="support@nomic.ai",
|
||||||
|
Loading…
Reference in New Issue
Block a user