Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add allow_download as class attribute for GPT4All #5512

Merged
merged 1 commit into from
May 31, 2023
Merged

add allow_download as class attribute for GPT4All #5512

merged 1 commit into from
May 31, 2023

Conversation

Vokturz
Copy link
Contributor

@Vokturz Vokturz commented May 31, 2023

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 class 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

Reviewers

@dev2049 dev2049 added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label May 31, 2023
@dev2049
Copy link
Contributor

dev2049 commented May 31, 2023

thanks @Vokturz!

@dev2049 dev2049 merged commit f39340f into langchain-ai:master May 31, 2023
@danielchalef danielchalef mentioned this pull request Jun 5, 2023
Undertone0809 pushed a commit to Undertone0809/langchain that referenced this pull request Jun 19, 2023
# 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>
This was referenced Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm PR looks good. Use to confirm that a PR is ready for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants