mirror of https://github.com/hwchase17/langchain
Add allow_download as attribute for GPT4All (#5512)
# Added support for download GPT4All model if does not exist I've include the class attribute `allow_download` to the GPT4All class. By default, `allow_download` is set to False. ## Changes Made - Added a new attribute `allow_download` to the GPT4All class. - Updated the `validate_environment` method to pass the `allow_download` parameter to the GPT4All model constructor. ## Context This change provides more control over model downloading in the GPT4All class. Previously, if the model file was not found in the cache directory `~/.cache/gpt4all/`, the package returned error "Failed to retrieve model (type=value_error)". Now, if `allow_download` is set as True then it will use GPT4All package to download it . With the addition of the `allow_download` attribute, users can now choose whether the wrapper is allowed to download the model or not. ## Dependencies There are no new dependencies introduced by this change. It only utilizes existing functionality provided by the GPT4All package. ## Testing Since this is a minor change to the existing behavior, the existing test suite for the GPT4All package should cover this scenario Co-authored-by: Vokturz <victornavarrrokp47@gmail.com>pull/5525/head
parent
ea09c0846f
commit
f39340ff6b
Loading…
Reference in New Issue