Back to Mem0

Gpt4all

embedchain/notebooks/gpt4all.ipynb

2.0.11.1 KB
Original Source

Cookbook for using GPT4All with Embedchain

Step-1: Install embedchain package

python
!pip install embedchain[opensource]

GPT4All is free for all and doesn't require any API Key to use it. So you can use it for free!

python
from embedchain import App

Step-3 Create embedchain app and define your config

python
app = App.from_config(config={
    "llm": {
        "provider": "gpt4all",
        "config": {
            "model": "orca-mini-3b-gguf2-q4_0.gguf",
            "temperature": 0.5,
            "max_tokens": 1000,
            "top_p": 1,
            "stream": False
        }
    },
    "embedder": {
        "provider": "gpt4all",
        "config": {
            "model": "all-MiniLM-L6-v2"
        }
    }
})

Step-4: Add data sources to your app

python
app.add("https://www.forbes.com/profile/elon-musk")
python
while(True):
    question = input("Enter question: ")
    if question in ['q', 'exit', 'quit']:
        break
    answer = app.query(question)
    print(answer)