Update notebooks to use dict instead of yaml and remove dataloaders (#1075)
This commit is contained in:
@@ -24,50 +24,13 @@
|
||||
"- ollama serve"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Ns6RhPfbiitr"
|
||||
},
|
||||
"source": [
|
||||
"### Step-2: Define your llm and embedding model config (Going all out local inference, no need for OpenAI API Key)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {
|
||||
"id": "S9CkxVjriotB"
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"config = \"\"\"\n",
|
||||
"llm:\n",
|
||||
" provider: ollama\n",
|
||||
" config:\n",
|
||||
" model: 'llama2'\n",
|
||||
" temperature: 0.5\n",
|
||||
" top_p: 1\n",
|
||||
" stream: true\n",
|
||||
"\n",
|
||||
"embedder:\n",
|
||||
" provider: huggingface\n",
|
||||
" config:\n",
|
||||
" model: 'BAAI/bge-small-en-v1.5'\n",
|
||||
"\"\"\"\n",
|
||||
"\n",
|
||||
"# Write the multi-line string to a YAML file\n",
|
||||
"with open('ollama.yaml', 'w') as file:\n",
|
||||
" file.write(config)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "PGt6uPLIi1CS"
|
||||
},
|
||||
"source": [
|
||||
"### Step-3 Create embedchain app based on the config"
|
||||
"### Step-2 Create embedchain app and define your config (all local inference)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -93,7 +56,23 @@
|
||||
],
|
||||
"source": [
|
||||
"from embedchain import App\n",
|
||||
"app = App.from_config(config_path=\"ollama.yaml\")"
|
||||
"app = App.from_config(config={\n",
|
||||
" \"llm\": {\n",
|
||||
" \"provider\": \"ollama\",\n",
|
||||
" \"config\": {\n",
|
||||
" \"model\": \"llama2\",\n",
|
||||
" \"temperature\": 0.5,\n",
|
||||
" \"top_p\": 1,\n",
|
||||
" \"stream\": True\n",
|
||||
" }\n",
|
||||
" },\n",
|
||||
" \"embedder\": {\n",
|
||||
" \"provider\": \"huggingface\",\n",
|
||||
" \"config\": {\n",
|
||||
" \"model\": \"BAAI/bge-small-en-v1.5\"\n",
|
||||
" }\n",
|
||||
" }\n",
|
||||
"})"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -102,7 +81,7 @@
|
||||
"id": "XNXv4yZwi7ef"
|
||||
},
|
||||
"source": [
|
||||
"### Step-4: Add data sources to your app"
|
||||
"### Step-3: Add data sources to your app"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -159,7 +138,7 @@
|
||||
"id": "_7W6fDeAjMAP"
|
||||
},
|
||||
"source": [
|
||||
"### Step-5: All set. Now start asking questions related to your data"
|
||||
"### Step-4: All set. Now start asking questions related to your data"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user