Add 'device' to GPT4All (#11216)

Add device to GPT4All

- **Description:** GPT4All now supports GPU. This commit adds the option
to enable it.
- **Issue:** It closes
https://github.com/langchain-ai/langchain/issues/10486

---------

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
pull/11075/head
니콜라스 10 months ago committed by GitHub
parent 92683262f4
commit c6d7124675
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -89,6 +89,9 @@ class GPT4All(LLM):
allow_download: bool = False
"""If model does not exist in ~/.cache/gpt4all/, download it."""
device: Optional[str] = Field("cpu", alias="device")
"""Device name: cpu, gpu, nvidia, intel, amd or DeviceName."""
client: Any = None #: :meta private:
class Config:
@ -141,6 +144,7 @@ class GPT4All(LLM):
model_path=model_path or None,
model_type=values["backend"],
allow_download=values["allow_download"],
device=values["device"],
)
if values["n_threads"] is not None:
# set n_threads

Loading…
Cancel
Save