repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | { |
| #2 | "cells": [ |
| #3 | { |
| #4 | "cell_type": "markdown", |
| #5 | "metadata": { |
| #6 | "id": "b02n_zJ_hl3d" |
| #7 | }, |
| #8 | "source": [ |
| #9 | "## Cookbook for using GPT4All with Embedchain" |
| #10 | ] |
| #11 | }, |
| #12 | { |
| #13 | "cell_type": "markdown", |
| #14 | "metadata": { |
| #15 | "id": "gyJ6ui2vhtMY" |
| #16 | }, |
| #17 | "source": [ |
| #18 | "### Step-1: Install embedchain package" |
| #19 | ] |
| #20 | }, |
| #21 | { |
| #22 | "cell_type": "code", |
| #23 | "execution_count": null, |
| #24 | "metadata": { |
| #25 | "colab": { |
| #26 | "base_uri": "https://localhost:8080/" |
| #27 | }, |
| #28 | "id": "-NbXjAdlh0vJ", |
| #29 | "outputId": "077fa470-b51f-4c29-8c22-9c5f0a9cef47" |
| #30 | }, |
| #31 | "outputs": [], |
| #32 | "source": [ |
| #33 | "!pip install embedchain[opensource]" |
| #34 | ] |
| #35 | }, |
| #36 | { |
| #37 | "cell_type": "markdown", |
| #38 | "metadata": { |
| #39 | "id": "nGnpSYAAh2bQ" |
| #40 | }, |
| #41 | "source": [ |
| #42 | "### Step-2: Set GPT4ALL related environment variables\n", |
| #43 | "\n", |
| #44 | "GPT4All is free for all and doesn't require any API Key to use it. So you can use it for free!" |
| #45 | ] |
| #46 | }, |
| #47 | { |
| #48 | "cell_type": "code", |
| #49 | "execution_count": null, |
| #50 | "metadata": { |
| #51 | "id": "0fBdQ9GAiRvK" |
| #52 | }, |
| #53 | "outputs": [], |
| #54 | "source": [ |
| #55 | "from embedchain import App" |
| #56 | ] |
| #57 | }, |
| #58 | { |
| #59 | "cell_type": "markdown", |
| #60 | "metadata": { |
| #61 | "id": "PGt6uPLIi1CS" |
| #62 | }, |
| #63 | "source": [ |
| #64 | "### Step-3 Create embedchain app and define your config" |
| #65 | ] |
| #66 | }, |
| #67 | { |
| #68 | "cell_type": "code", |
| #69 | "execution_count": null, |
| #70 | "metadata": { |
| #71 | "colab": { |
| #72 | "base_uri": "https://localhost:8080/" |
| #73 | }, |
| #74 | "id": "Amzxk3m-i3tD", |
| #75 | "outputId": "775db99b-e217-47db-f87f-788495d86f26" |
| #76 | }, |
| #77 | "outputs": [], |
| #78 | "source": [ |
| #79 | "app = App.from_config(config={\n", |
| #80 | " \"llm\": {\n", |
| #81 | " \"provider\": \"gpt4all\",\n", |
| #82 | " \"config\": {\n", |
| #83 | " \"model\": \"orca-mini-3b-gguf2-q4_0.gguf\",\n", |
| #84 | " \"temperature\": 0.5,\n", |
| #85 | " \"max_tokens\": 1000,\n", |
| #86 | " \"top_p\": 1,\n", |
| #87 | " \"stream\": False\n", |
| #88 | " }\n", |
| #89 | " },\n", |
| #90 | " \"embedder\": {\n", |
| #91 | " \"provider\": \"gpt4all\",\n", |
| #92 | " \"config\": {\n", |
| #93 | " \"model\": \"all-MiniLM-L6-v2\"\n", |
| #94 | " }\n", |
| #95 | " }\n", |
| #96 | "})" |
| #97 | ] |
| #98 | }, |
| #99 | { |
| #100 | "cell_type": "markdown", |
| #101 | "metadata": { |
| #102 | "id": "XNXv4yZwi7ef" |
| #103 | }, |
| #104 | "source": [ |
| #105 | "### Step-4: Add data sources to your app" |
| #106 | ] |
| #107 | }, |
| #108 | { |
| #109 | "cell_type": "code", |
| #110 | "execution_count": null, |
| #111 | "metadata": { |
| #112 | "colab": { |
| #113 | "base_uri": "https://localhost:8080/", |
| #114 | "height": 52 |
| #115 | }, |
| #116 | "id": "Sn_0rx9QjIY9", |
| #117 | "outputId": "c6514f17-3cb2-4fbc-c80d-79b3a311ff30" |
| #118 | }, |
| #119 | "outputs": [], |
| #120 | "source": [ |
| #121 | "app.add(\"https://www.forbes.com/profile/elon-musk\")" |
| #122 | ] |
| #123 | }, |
| #124 | { |
| #125 | "cell_type": "markdown", |
| #126 | "metadata": { |
| #127 | "id": "_7W6fDeAjMAP" |
| #128 | }, |
| #129 | "source": [ |
| #130 | "### Step-5: All set. Now start asking questions related to your data" |
| #131 | ] |
| #132 | }, |
| #133 | { |
| #134 | "cell_type": "code", |
| #135 | "execution_count": null, |
| #136 | "metadata": { |
| #137 | "colab": { |
| #138 | "base_uri": "https://localhost:8080/", |
| #139 | "height": 480 |
| #140 | }, |
| #141 | "id": "cvIK7dWRjN_f", |
| #142 | "outputId": "c74f356a-d2fb-426d-b36c-d84911397338" |
| #143 | }, |
| #144 | "outputs": [], |
| #145 | "source": [ |
| #146 | "while(True):\n", |
| #147 | " question = input(\"Enter question: \")\n", |
| #148 | " if question in ['q', 'exit', 'quit']:\n", |
| #149 | " break\n", |
| #150 | " answer = app.query(question)\n", |
| #151 | " print(answer)" |
| #152 | ] |
| #153 | } |
| #154 | ], |
| #155 | "metadata": { |
| #156 | "colab": { |
| #157 | "provenance": [] |
| #158 | }, |
| #159 | "kernelspec": { |
| #160 | "display_name": "Python 3", |
| #161 | "name": "python3" |
| #162 | }, |
| #163 | "language_info": { |
| #164 | "name": "python" |
| #165 | } |
| #166 | }, |
| #167 | "nbformat": 4, |
| #168 | "nbformat_minor": 0 |
| #169 | } |
| #170 |