langchain/docs/extras/modules
Lance Martin 265c285057
Fix GPT4All bug w/ "n_ctx" param (#7093)
Running `GPT4All` per the
[docs](https://python.langchain.com/docs/modules/model_io/models/llms/integrations/gpt4all),
I see:

```
$ from langchain.llms import GPT4All
$ model = GPT4All(model=local_path)
$ model("The capital of France is ", max_tokens=10)
TypeError: generate() got an unexpected keyword argument 'n_ctx'
```

It appears `n_ctx` is [no longer a supported
param](https://docs.gpt4all.io/gpt4all_python.html#gpt4all.gpt4all.GPT4All.generate)
in the GPT4All API from https://github.com/nomic-ai/gpt4all/pull/1090.

It now uses `max_tokens`, so I set this.

And I also set other defaults used in GPT4All client
[here](https://github.com/nomic-ai/gpt4all/blob/main/gpt4all-bindings/python/gpt4all/gpt4all.py).

Confirm it now works:
```
$ from langchain.llms import GPT4All
$ model = GPT4All(model=local_path)
$ model("The capital of France is ", max_tokens=10)
< Model logging > 
"....Paris."
```

---------

Co-authored-by: R. Lance Martin <rlm@Rs-MacBook-Pro.local>
2023-07-04 08:53:52 -07:00
..
agents added Brave Search document_loader (#6989) 2023-07-02 19:01:24 -07:00
callbacks Remove Promptlayer Notebook (#6996) 2023-06-30 14:30:24 -07:00
chains Add New Retriever Interface with Callbacks (#5962) 2023-06-30 14:44:03 -07:00
data_connection Minor updates to notebook for MultiQueryRetriever (#7102) 2023-07-03 17:32:50 -07:00
memory Align cassio versions between examples for Cassandra integration (#7099) 2023-07-04 04:21:48 -06:00
model_io Fix GPT4All bug w/ "n_ctx" param (#7093) 2023-07-04 08:53:52 -07:00
paul_graham_essay.txt Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
state_of_the_union.txt Doc refactor (#6300) 2023-06-16 11:52:56 -07:00