From 4488234d648d80023587573292406638b7ab80be Mon Sep 17 00:00:00 2001 From: Bob Lin Date: Tue, 2 Jan 2024 10:57:57 -0600 Subject: [PATCH] Update `gpt4all.mdx` doc (#15392) The [pyllamacpp](https://github.com/nomic-ai/pyllamacpp) repository has been archived and the model name and usage need to be changed. --- docs/docs/integrations/providers/gpt4all.mdx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/docs/integrations/providers/gpt4all.mdx b/docs/docs/integrations/providers/gpt4all.mdx index 0917bff1a30..01cc169803b 100644 --- a/docs/docs/integrations/providers/gpt4all.mdx +++ b/docs/docs/integrations/providers/gpt4all.mdx @@ -4,8 +4,15 @@ This page covers how to use the `GPT4All` wrapper within LangChain. The tutorial ## Installation and Setup -- Install the Python package with `pip install pyllamacpp` -- Download a [GPT4All model](https://github.com/nomic-ai/pyllamacpp#supported-model) and place it in your desired directory +- Install the Python package with `pip install gpt4all` +- Download a [GPT4All model](https://gpt4all.io/index.html) and place it in your desired directory + +In this example, We are using `mistral-7b-openorca.Q4_0.gguf`(Best overall fast chat model): + +```bash +mkdir models +wget https://gpt4all.io/models/gguf/mistral-7b-openorca.Q4_0.gguf -O models/mistral-7b-openorca.Q4_0.gguf +``` ## Usage @@ -17,7 +24,7 @@ To use the GPT4All wrapper, you need to provide the path to the pre-trained mode from langchain.llms import GPT4All # Instantiate the model. Callbacks support token-wise streaming -model = GPT4All(model="./models/gpt4all-model.bin", n_ctx=512, n_threads=8) +model = GPT4All(model="./models/mistral-7b-openorca.Q4_0.gguf", n_threads=8) # Generate text response = model("Once upon a time, ") @@ -35,7 +42,7 @@ from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler # from langchain.callbacks.streamlit import StreamlitCallbackHandler callbacks = [StreamingStdOutCallbackHandler()] -model = GPT4All(model="./models/gpt4all-model.bin", n_ctx=512, n_threads=8) +model = GPT4All(model="./models/mistral-7b-openorca.Q4_0.gguf", n_threads=8) # Generate text. Tokens are streamed through the callback manager. model("Once upon a time, ", callbacks=callbacks) @@ -43,6 +50,6 @@ model("Once upon a time, ", callbacks=callbacks) ## Model File -You can find links to model file downloads in the [pyllamacpp](https://github.com/nomic-ai/pyllamacpp) repository. +You can find links to model file downloads in the [https://gpt4all.io/](https://gpt4all.io/index.html). For a more detailed walkthrough of this, see [this notebook](/docs/integrations/llms/gpt4all)