add allow_download as class attribute for GPT4All #5512
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
allow_download
, to the GPT4All class.validate_environment
method to pass theallow_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, ifallow_download
is set as True then it will use GPT4All package to download it . With the addition of theallow_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
Reviewers